日期:2014-05-16  浏览次数:20358 次

js中下拉菜单问题求助了
由于刚学js,不少例子中语句看不明白,向各位请教了。js代码中注有?????号的地方
HTML code

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Sample</title>
<style type="text/css">
<!--
#mainNav {
    position: absolute;
    top:2px;
    height:30px;
    width:800px;
}
.mainItem {
    position: absolute;
    top:3px;
    height:27px;
    width:74px;
    padding:10px 0px;
    margin:0px;
    text-align:center;
    font-size:13px;
    background-image: url(images/tab1.gif);
    background-repeat:repeat-x;
}
.subItemNav {
    position: absolute;
    top: 30px;
    left: 0px;
    width: 100%;
    height: 20px;
    padding: 2px 0px 0px 100px;
    visibility: hidden;
    background-color:#61B38B;
}
.subItemNav a:link, .subItemNav a:visited {
    font-size: 80%;
    color: #ffffff;
}
.subItemNav a:hover {
    color: #cccccc;
}
</style>
</head>

<body onmousemove="closeAllSubItem(event);">
<div id="headerNav">
      <div id="mainNav">
                <div id="mainItem1" class="mainItem"
                         onmouseover="displaySubItem(this);">开发王</div>
                <div id="mainItem2" class="mainItem"
                         onmouseover="displaySubItem(this);">最佳拍档</div>
                <div id="mainItem3" class="mainItem"
                         onmouseover="displaySubItem(this);">Flash</div>
                <div id="mainItem4" class="mainItem"
                         onmouseover="displaySubItem(this);">简体中文</div>
                <div id="mainItem5" class="mainItem"
                         onmouseover="displaySubItem(this);">繁体中文</div>
                <div id="mainItem6" class="mainItem"
                         onmouseover="displaySubItem(this);">其它语言</div>
      </div>    
      <div id="subMenu1" class="subItemNav">
        <a href="#">HTML</a> | 
        <a href="#">CSS</a> | 
        <a href="#">JavaScript</a> | 
        <a href="#">ASP</a> | 
        <a href="#">ASP.NET(VB)</a> | 
        <a href="#">ASP.NET(C#)</a> | 
        <a href="#">JSP</a> | 
        <a href="#">PHP</a>
      </div>
      <div id="subMenu2" class="subItemNav">
        <a href="#">HTML/CSS/JavaScript</a> | 
        <a href="#">ASP</a> | 
        <a href="#">ASP.NET(VB)</a> | 
        <a href="#">ASP.NET(C#)</a> | 
        <a href="#">JSP</a> | 
        <a href="#">PHP</a>
      </div>
      <div id="subMenu3" class="subItemNav">
        <a href="#">动画王</a> | 
        <a href="#">开发王</a> | 
        <a href="#">FMS</a> | 
        <a href="#">Flash Player:The Missing Manual</a> | 
        <a href="#">ASP.NET for Flash</a> | 
        <a href="#">ASP for Flash</a> | 
        <a href="#">JSP for Flash</a> | 
        <a href="#">PHP for Flash</a>
      </div>
     
      <div id="subMenu4" class="subItemNav">
        <a href="#">some link</a> | 
        <a href="#">some link</a> 
      </div>
      &l