JavaScript ¶à¼¶²Ëµ¥
ʵÏÖЧ¹û£º
ÒýÈëJSºÍCSSÎļþ£º
<mce:script type='text/javascript' src="dropdown/jquery-1.2.3.min.js" mce_src="dropdown/jquery-1.2.3.min.js"></mce:script>
<mce:script type='text/javascript' src="dropdown/menu.js" mce_src="dropdown/menu.js"></mce:script>
<link rel="stylesheet" href="dropdown/style.css" mce_href="dropdown/style.css" type="text/css" media="screen" />
style.css Code:
body{
font-size:0.85em;
font-family:Verdana, Arial, Helvetica, sans-serif;
}
#div{
line-height:1.5em;
list-style-type: none;
width: 300px;
margin-right: auto;
margin-left: auto;
}
#nav, #nav ul{
margin:0;
padding:0;
list-style-type:none;
list-style-position:outside;
position:relative;
line-height:1.5em;
}
#nav a{
display:block;
padding:0px 5px;
border:1px solid #333;
color:#fff;
text-decoration:none;
background-color:#333;
}
#nav a:hover{
background-color:#fff;
color:#333;
}
#nav li{
float:left;
position:relative;
}
#nav ul {
position:absolute;
display:none;
width:3em;
top:1.5em;
}
#nav li ul a{
width:10em; /*¿ØÖƸ¸²Ëµ¥µ¯³ö²Ëµ¥¿í¶È*/
height:auto;
float:left;
}
#nav ul ul{
top:auto;
}
#nav li ul ul {
left:10em;
margin:0px 0 0 10px;
}
#nav li:hover ul ul, #nav li:hover ul ul ul, #nav li:hover ul ul ul ul{
display:none;
}
#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li li li li:hover ul{
display:block;
}
menu.js Code:
function mainmenu(){
$(" #nav ul ").css({display: "none"}); // Opera Fix
$(" #nav li").hover(function(){
$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
},function(){
$(this).find('ul:first').css({visibility: "hidden"});
});
}
$(document).ready(function(){
mainmenu();
});
<div id="div">
<ul id="nav" >
<li><a href="#" mce_href="#">ASP.NET</a>
<ul>
<li><a href="#" mce_href="#">ASP.NET AJAX</a></l
Ïà¹ØÎĵµ£º
scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......
javascript¶¨Òå¶þάÊý×éµÄ·½·¨ javascript±¾ÉíÖ»Ö§³ÖһάÊý×飬
ÓÐʱ·ÇÒªÓõ½¶þάÊý×éµÄʱºò£¬ ¿ÉÒÔ½«Ò»Î¬Êý×éµÄ·ÖÏîÓÖ¶¨ÒåΪһ¸öÊý×飬 ¶þάÊý×é¾ÍÊÇÓÃÊý×é¹¹³ÉµÄÊý×é
Var aa=new Array(); //¶¨ÒåһάÊý×é
for(i=1;i<=10;i++)
{
aa[i]=new Array(); //½«Ã¿Ò»¸ö×ÓÔªËØÓÖ¶¨ÒåΪÊý ......
//ÅжÏÊäÈëÄÚÈÝÊÇ·ñΪ¿Õ
function IsNull(){
var str = document.getElementById('str').value.trim();
if(str.length==0){
alert('¶Ô²»Æð£¬Îı¾¿ò²»ÄÜΪ¿Õ»òÕßΪ¿Õ¸ñ!');//Ç뽫“Îı¾¿ò”¸Ä³ÉÄãÐèÒªÑéÖ¤µÄÊôÐÔÃû³Æ!
}
}
//ÅжÏÈÕÆÚÀàÐÍÊÇ·ñÎ ......
JavaScript »ñÈ¡¿Í»§¶Ë¼ÆËã»úÓ²¼þ¼°ÏµÍ³ÐÅÏ¢
ͨ¹ýWMIÀ´ÊµÏÖ»ñÈ¡¿Í»§¶Ë¼ÆËã»úÓ²¼þ¼°ÏµÍ³ÐÅÏ¢:
1//ϵͳÐÅÏ¢»ñÈ¡
2function getSysInfo(){
3 var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
4 var service = locator.ConnectServer(".");
5 //CPUÐÅÏ¢
6 var cpu = new Enu ......
1.substring ·½·¨
¶¨ÒåºÍÓ÷¨
substring ·½·¨ÓÃÓÚÌáÈ¡×Ö·û´®ÖнéÓÚÁ½¸öÖ¸¶¨Ï±êÖ®¼äµÄ×Ö·û¡£
Óï·¨
stringObject.substring(start,stop)
²ÎÊý ÃèÊö
start ±ØÐè¡£Ò»¸ö·Ç¸ºµÄÕûÊý£¬¹æ¶¨ÒªÌáÈ¡µÄ×Ó´®µÄµÚÒ»¸ö×Ö·ûÔÚ stringObject ÖеÄλÖá£
stop ¿ÉÑ¡¡£Ò»¸ö·Ç¸ºµÄÕûÊý£¬±ÈÒªÌáÈ¡µÄ×Ó´®µÄ×îºóÒ»¸ö×Ö·û ......