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
Ïà¹ØÎĵµ£º
¸Õ¸Õ°Ý¶ÁÁË JavascriptµÄ±äÁ¿Óëdelete²Ù×÷·û ºÜÊÜÆô·¢¡£ÔÎÄֻ˵Á˽á¹û£¬Ã»¸üÉîÈëÍÆÀí×ܽáÒ»ÏÂΪʲô£¬ÒÔ¼°ÔõôÀí½âºÃÒ»µã£¬ÎÒÕâÀï²¹³ä×ܽáһϡ£
/// <reference path="http://tech.idv2.com/2008/01/09/javascript-variables-and-delete-operator/" />
/*
Óëc++²»Í¬£¬javascriptµÄdelete²»»áɾ³ ......
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 ......
ѧϰÁ˽âÁËjavascriptµÄһЩԪËضÔÏóµÄ´´½¨£¬»ñÈ¡µÈ¡£ÏÖÔÚµÄѧϰÖ÷ÒªÊÇÉæ¼°ÔÚ±àдjavascriptµ±ÖÐÓ¦¸Ã×¢ÒâµÄһЩϸ½Ú£º
1 ×¢Òâ±äÁ¿µÄ±àдÕýÈ·
2 ²ÎÊý´«µÝ³öÏÖÎÊÌâ »òÕß²»´æÔÚÒ²»áµ¼Ö³ö´í
3 js´íÎóµÄ¿ØÖƺ¯Êý window.onerror£ºÆ佫»á´øÈý¸ö²ÎÊýÐÅÏ¢ ¿Éͨ¹ý²ÎÊýÊý×é arguments »ñÈ¡ÐÅÏ¢ ´íÎóÐÅÏ¢£¬´íÎóÒ³ÃæµÄurlºÍ´í ......
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 ¿ÉÑ¡¡£Ò»¸ö·Ç¸ºµÄÕûÊý£¬±ÈÒªÌáÈ¡µÄ×Ó´®µÄ×îºóÒ»¸ö×Ö·û ......