- 12月 12 週五 200807:46
javascript圖片click放大
- 9月 12 週五 200809:40
禁止滑鼠案右鍵-javascript功能
禁止滑鼠暗右鍵的做法
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>全面禁止鼠標右鍵、FX、Alt、Ctrl、Shift等</title> </head> <mce:script type="text/javascript"><!-- function onKeyDown() { if ((event.keyCode==116)||(window.event.ctrlKey)||(window.event.shiftKey)||(event.keyCode==122)) { event.keyCode=0; event.returnValue=false; } } // --></mce:script> <mce:script type="text/javascript"><!-- function yxl() { if(window.event.altKey) { window.event.returnValue=false; } } document.onkeydown=yxl // --></mce:script> <body bgcolor="#cccccc" text="#666666" onkeydown="onKeyDown()" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" > <div mce_tmp="1">該頁面禁止了鼠標右鍵,F5、F11、「應用程序」鍵,所有與alt、ctrl和shift有關的組合鍵</div> <div mce_tmp="1"> </div> </body> </html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>全面禁止鼠標右鍵、FX、Alt、Ctrl、Shift等</title> </head> <mce:script type="text/javascript"><!-- function onKeyDown() { if ((event.keyCode==116)||(window.event.ctrlKey)||(window.event.shiftKey)||(event.keyCode==122)) { event.keyCode=0; event.returnValue=false; } } // --></mce:script> <mce:script type="text/javascript"><!-- function yxl() { if(window.event.altKey) { window.event.returnValue=false; } } document.onkeydown=yxl // --></mce:script> <body bgcolor="#cccccc" text="#666666" onkeydown="onKeyDown()" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" > <div mce_tmp="1">該頁面禁止了鼠標右鍵,F5、F11、「應用程序」鍵,所有與alt、ctrl和shift有關的組合鍵</div> <div mce_tmp="1"> </div> </body> </html>
- 9月 12 週五 200800:45
用jQuery寫Drag and Drop心得1
parents( expr ) http://docs.jquery.com/API/1.1/DOM/Traversing Get a set of elements containing the unique ancestors of the matched set of elements (except for the root element). Can be filtered with an optional expressions. Return value: jQueryParameters: expr (String): (optional) An expression to filter the ancestors with appendTo( content ) 網址: http://docs.jquery.com/Manipulation/appendTo show( speed, callback ) Returns: jQuery Show all matched elements using a graceful animation and firing an optional callback after completion. hide( ) Hides each of the set of matched elements if they are shown. Same as hide( speed, [callback] ) without animations. Doesn't change anything if the selected elements are all hidden. Demo : View SourceHides all paragraphs then the link on click. $("p").hide(); $("a").click(function () { $(this).hide(); return false; }); EFFECTS/ELEMENATE http://docs.jquery.com/Effects/animate#paramsdurationeasingcallback animate( params, [duration], [easing], [callback] ) DemoView SourceShows a div animate with a relative move. Click several times on the buttons to see the relative animations queued up. $("#right").click(function(){ $(".block").animate({"left": "+=50px"}, "slow"); }); $("#left").click(function(){ $(".block").animate({"left": "-=50px"}, "slow"); }); 希望能寫出可以拖拉但本身不會被移走的圖片
1
