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

javascript ¿ØÖÆ htmlÔªËØ ÏÔʾ/Òþ²Ø


javascript ¿ØÖÆ htmlÔªËØ ÏÔʾ/Òþ²Ø
1¡£±àдjsº¯Êý
 <script type="text/javascript">
function display(y){$(y).style.display=($(y).style.display=="none")?"":"none";} 
function $(s){return document.getElementById(s);}
 </script>
2. ÒªÏÔʾ/Òþ²ØµÄhtmlÔªËØ¼ÓÉÏ id ÊôÐÔ
<table>
   <tr id="menu" >   
      <td>¿ØÖÆÕâ¸ötrµÄÏÔʾ/Òþ²Ø</td>
  </tr>
</table>
3£¬Ìí¼Ó°´Å¥£¬Á´½ÓµÈ´¥·¢ js º¯Êý
<input type="button" onclick="display('menu')"  value="ÏÔʾ/Òþ²Ø"/>
<a href="#"  onclick="display('menu')"  >ÏÔʾ/Òþ²Ø</a>
javascriptÏÔʾÒþ²Ø²ã<div id="layer" style="display:none;">¹ã¸æ</div>
<input type="botton" onclick="display(layer)">
¶þ:javascript¿ØÖÆÒ³Ãæ¿Ø¼þÒþ²ØÏÔʾµÄÁ½ÖÖ·½·¨
javascript¿ØÖÆÒ³Ãæ¿Ø¼þÒþ²ØÏÔʾµÄÁ½ÖÖ·½·¨£¬·½·¨µÄ²»Í¬Ö®´¦ÔÚÓڿؼþÒþ²ØºóÊÇ·ñ»¹ÔÚÒ³ÃæÉÏռλ
·½·¨Ò»£º
document.all["PanelSMS"].style.visibility="hidden"; 
document.all["PanelSMS"].style.visibility="visible";
·½·¨¶þ£º
document.all["PanelSMS"].style.display="none"; 
document.all["PanelSMS"].style.display="inline";
·½·¨Ò»Òþ²Øºó Ò³ÃæµÄλÖû¹±»¿Ø¼þÕ¼Óà ֻÊDz»ÏÔʾ 
·½·¨¶þÒþ²Øºó Ò³ÃæµÄλÖò»±»Õ¼ÓÃ


Ïà¹ØÎĵµ£º

HtmlÖÐDocumentºÍEventÀï¸÷ÖÖ×ø±êµÄ¶¨Òå

±¾ÎÄת×Ô£ºhttp://hi.baidu.com/gle_el/blog/item/43d0f6f464577a68dcc47431.html
event.x   £¬event.y:Óë´¥·¢Ê¼þµÄ¶ÔÏóÏà¹ØµÄÊó±êλÖõÄXY×ø±ê;
offsetTop
»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓÉ offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¼ÆËã¶¥¶ËλÖá£
offsetLeft
»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓÉ offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¼ÆËã ......

javascriptÊó±êʼþ´óÈ«

jsÊó±êʼþ´óÈ«2008Äê01ÔÂ14ÈÕ ÐÇÆÚÒ» 08:54Ò»°ãʼþ ʼþ ä¯ÀÀÆ÷Ö§³Ö ÃèÊö
onClick IE3|N2|O3 Êó±êµã»÷ʼþ£¬¶àÓÃÔÚij¸ö¶ÔÏó¿ØÖƵķ¶Î§ÄÚµÄÊó±êµã»÷
onDblClick IE4|N4|O Êó±êË«»÷ʼþ
onMouseDown IE4|N4|O Êó±êÉϵİ´Å¥±»°´ÏÂÁË
onMouseUp IE4|N4|O Êó±ê°´Ïºó£¬ËÉ¿ªÊ±¼¤·¢µÄʼþ
onMouseO ......

JAVASCRIPTµÄinstanceof·ÖÎö

 function class1(){
alert("class1");
};
function class2(){
alert("class2");
}
class2.prototype=class1.prototype;
var obj=new class2();
alert(obj instanceof class1);
alert(obj instanceof class2);
alert(class2.prototype.constructor);
class2.prototype.constructor(); ......

javascript ֪ʶ ±Ê¼Ç

javascriptÖеÄsubstr ºÍsubstringµÄÇø±ð:
1.substr ·½·¨
·µ»ØÒ»¸ö´ÓÖ¸¶¨Î»ÖÿªÊ¼µÄÖ¸¶¨³¤¶ÈµÄ×Ó×Ö·û´®¡£
stringvar.substr(start [, length ])
²ÎÊý
stringvar
±ØÑ¡Ïî¡£ÒªÌáÈ¡×Ó×Ö·û´®µÄ×Ö·û´®ÎÄ×Ö»ò String ¶ÔÏó¡£
start
±ØÑ¡Ïî¡£ËùÐèµÄ×Ó×Ö·û´®µÄÆðʼλÖá£×Ö·û´®ÖеĵÚÒ»¸ö×Ö·ûµÄË÷ÒýΪ 0¡£
length
¿ÉÑ¡Ïî¡£Ô ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ