°´¶ÔÏó·½Ê½µ÷ÓÃjavascriptµÄÀý×Ó
Ò³Ã棺
<script type="text/javascript" src="js/test.js"></script>
¡£¡£¡£¡£
<body onload="new myTest();" >
ÒÔ¶ÔÏó·½Ê½µ÷ÓÃÐèҪʹÓà new ²Ù×÷·û£¬test.jsµÄÄÚÈÝ:
{ //ʹÓôóÀ¨ºÅ±íʾÒÔÀàµÄÐÎʽµ÷ÓÃmyTest
function myTest()
{
this.addActions1();
};
alert('will process here....');//will execute this row
myTest.prototype.addActions1=function()
{
alert('hi2');
};
}
//Ò³ÃæÖÐÓÃnew myTest()µ÷ÓûáÖ´ÐÐmyTest()ÖеÄaddActions1(),ÁíÍâÔÚfunctionÖпÉÒÔʹÓÃthisÀ´ÒýÓú¯Êý¡£
Ïà¹ØÎĵµ£º
scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......
ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type
²¶»ñÊÍ·Å
event.srcElement.setCapture();
event.srcElement.releaseCapture();
ʼþ°´¼ü
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
ʼþ·µ»ØÖµ
event.returnValue
Êó±êλÖÃ
event.x ......
JavaScript È«¾Ö±äÁ¿ÊÇÆäʵÊÇÖ¸:ÉÏÏÂÎÄ»·¾³ WindowϵĶÔÏóÊôÐÔ
JavaScript×÷ÓÃÓòÊÇ»ùÓÚÉÏÏÂÎÄ,ÊÇÒÔº¯Êý½øÐл®·ÖµÄ£¬¶ø²»ÊÇÓɿ飨block£©»®·ÖµÄ
JavaScriptÔÊÐí±äÁ¿µÄÖظ´¶¨Òå,²¢ÇÒºóÒ»¸ö¶¨Ò彫¸²¸ÇÇ°Ò»¸ö¶¨Òå,Èç¹ûºóÒ»¸ö±äÁ¿ÊǾֲ¿±äÁ¿Ò²»á¸²¸ÇÇ°Ò»¸öÈ«¾Ö±äÁ¿
ÒÔÏÂÊÇÒ»¸öÀý×Ó:
<scri ......
ðÅÝÐÍʼþ ʼþ·¢ÉúÓÉÄÚ¶øÍâ
¿ÉÒÔ¶Ôʱ¼ä´«µÝº¯ÊýÒÔÓ¦¶Ô¶¯×÷µÄ´Ù·¢
oP.attachEvent("onclick",fnClick); ¶Ô¶ÔÏóÔö¼ÓÒ»¸ö¼àÌýº¯Êý£¬Í¬Ò»¸ö¶ÔÏó¿ÉÒÔ¼àÌýÏàͬʼþ¶ÔÓ¦²»Í¬µÄʼþ´¦Àíº¯Êý Ö´ÐÐ˳ÐòºóÓÅÏÈ oP.detachEvent("onclick",fnClick);ɾ³ý¼àÌý ÊʺÏÓÃÓ ......
JavaScriptʹÓ÷½·¨ºÍ¼¼ÇÉ´óÈ«
ÓÐЩʱºòÄ㾫ͨһÃÅÓïÑÔ£¬µ«ÊǻᷢÏÖÄãÆäʵÕûÌìÔÚºÍÆäËüÓïÑÔ´ò½»µÀ£¬Ò²ÐíÄãÒÔΪÕâЩ΢²»×ãµÀ£¬²»ÖÁÓÚÓ°ÏìÄãµÄ¿ª·¢½ø¶È£¬µ«Ç¡Ç¡ÊÇÕâЩÄã²»ÖØÊӵĶ«Î÷»áÀË·ÑÄãºÜ¶àʱ¼ä£¬ÎÒÒ»Ö±ÒÔΪÎÒÔçÔÚ¼¸ÄêÇ°¾ÍÒѾ¾«Í¨JavaScriptÁË£¬Ö±µ½Ä¿Ç°£¬ÎÒ²ÅÔ½ ......