Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaScript »ñÈ¡¶ÔÏóµÄ¸ß¶ÈºÍ¿í¶ÈÏêϸ˵Ã÷

scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetLeft:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓÉ offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¼ÆËã×ó²àλÖÃ
offsetTop:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓÉ offsetTop ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¼ÆË㶥¶ËλÖÃ
event.clientX Ïà¶ÔÎĵµµÄˮƽ×ù±ê
event.clientY Ïà¶ÔÎĵµµÄ´¹Ö±×ù±ê
event.offsetX Ïà¶ÔÈÝÆ÷µÄˮƽ×ø±ê
event.offsetY Ïà¶ÔÈÝÆ÷µÄ´¹Ö±×ø±ê
document.documentElement.scrollTop ´¹Ö±·½Ïò¹ö¶¯µÄÖµ
event.clientX+document.documentElement.scrollTop Ïà¶ÔÎĵµµÄˮƽ×ù±ê+´¹Ö±·½Ïò¹ö¶¯µÄÁ¿


Ïà¹ØÎĵµ£º

javascriptÖÐʼþeventÏê½â

½Å±¾ÖеÄʼþÓÐ2ÖÖÄ£ÐÍ
1¡¢  ðÅÝÐÍʼþ£ºÊ¼þÊÇ°´ÕÕ´Ó×îÌض¨µÄÄ¿±êµ½×î²»Ìض¨µÄʼþÄ¿±ê(document)µÄ˳ÐòÒÀ´Î´¥·¢¡£ÕâÊÇÕë¶Ô²»Í¬ÔªËصÄͬһʼþÀàÐÍ
È磺
<html  onclick=”handleClick()”>
<head></head>
<body onclick=”handleClick()”>
  <div ......

javascript ×Ü½á ¡¶Ò»¡·

1£ºÈ¡µÃ±íµ¥ÖеÄTextBox ÖеÄÊý¾Ý£ºdocument.FormName.TextBox.value;
2:  ¿ØÖÆÔªËصÄÏÖʵºÍÒþ²Ø£ºÓÐvisibility  ºÍ display
Çø±ð£º1£©Ç°ÕßµÄÊôÐÔÖµÓУ¬visible¡¢hidden ¡£
         ºóÕßµÄÊôÐÔÖµÓУºblock ºÍ none£»
      2£©Ç°ÕßËäÈ»Òþ ......

JAVASCRIPT URLENCODE


function urlencode( str ) {
// http://kevin.vanzonneveld.net
// + original by: Philip Peterson
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// * example 1: urlencode('Kevin van Zonneveld!');
// * returns 1: 'Kevin+van+Zonneveld%21'
&nb ......

JavascriptÖÐ×î³£ÓõÄ55¸ö¾­µä¼¼ÇÉ

1. oncontextm ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)><td>no</table> ¿ÉÓÃÓÚTable
2. <body onselectst> È¡ÏûÑ¡È¡¡¢·ÀÖ¹¸´ÖÆ
3.  ²»×¼Õ³Ìù
4.   ·ÀÖ¹¸´ÖÆ
5. <link  > IEµØÖ·À¸Ç°»»³É×Ô¼ºµÄͼ±ê
6. <link   ......

JavaScriptÖÐÊý×é·½·¨

shift£ºÉ¾³ýÔ­Êý×éµÚÒ»Ï²¢·µ»Øɾ³ýÔªËصÄÖµ£»Èç¹ûÊý×éΪ¿ÕÔò·µ»Øundefined
var a = [1,2,3,4,5];
var b = a.shift(); //a£º[2,3,4,5]  b£º1
unshift£º½«²ÎÊýÌí¼Óµ½Ô­Êý×鿪ͷ£¬²¢·µ»ØÊý×éµÄ³¤¶È
var a = [1,2,3,4,5];
var b = a.unshift(-2,-1); //a£º[-2,-1,1,2,3,4,5]  b£º7
×¢£ºÔÚIE6.0ϲ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ