Javascript¼Ì³ÐÖ®¶ÔÏóð³ä·¨
ÀýÈ磺ÓÐÈý¸öÀàclassX,classY,classZ
classZ·Ö±ð¼Ì³ÐclassXºÍclassY
ÓÚÊǾÍÓÐÏÂÃæµÄд·¨£º
function ClassZ(){
this.newMethod=classX;
this.newMethod();
delete this.newMethod;
this.newMethod=classY;
this.newMethod();
delete this.newMethod;
}
ÕâÖÖд·¨´æÔÚÒ»¸ö±×¶Ë.¡£Èç¹ûclassXºÍclassYÓоßÓÐͬÃûµÄÊôÐÔ»ò·½·¨¡£classy¾ßÓиßÓÅÏȼ¶¡£
Ïà¹ØÎĵµ£º
Ч¹ûÑÝʾµØÖ·£ºhttp://www.phzzy.org/code/drag/google_drag.html
ÍÏ×§ÔÀí£º
¹ØÓÚÍÏ×§µÄ»ù´¡£¬¿ÉÒԲο¼ÕâÆªÎÄÕ£¬½²µÃ·Ç³£²»´í¡£
http://www.sohotx.com/mzk/index.php/1007/ArticleContent/298.html
ÆäʵÔÀíºÜ¼òµ¥£¬¾ÍÊǰѰó¶¨Èý¸öʼþ£ºonmousedown , onmousemove , onmouseup¡£
ÔÚÊó±êµãÏÂʱ(onmousedown)° ......
1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)><td>no</table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡Ïûѡȡ¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ³Ìù
4. oncopy="return false;" oncut="re ......
alert(parseInt("101101", 2))
ÔËÐдúÂë
function toBin(intNum) {
var answer = "";
if(/\d+/.test(intNum)) {
while(intNum != 0) {
answer = Math.abs(intNum%2)+answer;
intNum = parseInt(intNum/2);
}
......
JavaScriptÓï·¨¼¯½õÊǶÔjavascript³£Óú¯ÊýµÄһЩС½á£¬±È½ÏʵÓ㬽¨ÒéÊղأ¬·½±ã²éÕÒÐèÒªµÄ×ÊÁÏ¡£
click() ¶ÔÏó.click() ʹ¶ÔÏó±»µã»÷¡£
closed ¶ÔÏó.closed ¶ÔÏó´°¿ÚÊÇ·ñÒѹرÕtrue/false
clearTimeout(¶ÔÏó) Çå³ýÒÑÉèÖõÄsetTimeout¶ÔÏó
clearInterval(¶ÔÏó) Çå³ýÒÑÉèÖõÄsetInterval¶ÔÏó&n ......