首页一打开为什么二级菜单全部显示,等你分别停留过一级菜单他们才恢复正常,大神们救救我 - Web 开发 / Ajax
*{margin:0;padding:0;}
a{ text-decoration:none; color:#666;}
a:hover{ color:#000066;}
ul{ list-style:none;}
img{ border:none;}
body{ background:color:#E3DDDD; font-size:12px; text-align:center; font-family:Arial, Helvetica, sans-serif;width:1000px;margin:0px auto; }
.clear{ clear:both;}
.head{ width:1000px; margin:0px auto 5px;}
.ln{width:1000px;height:80px;}
.logo{float:left ;width:214px ; height:80px;background:url(../images/RRR.gif)}
.navi{float:left;width:786px; height:80px;background:url(../images/abc.jpg)}
.flah{width:1000px;}
a:link, a:visited {
color: #333;
text-decoration: none;
}
.nav {
width:786px;
float:right;
position: relative;
background:url(../images/lrtk.png) no-repeat 0 -36px;
text-align:center;
}
.navinner {
background: url(../images/lrtk.png) no-repeat 100% -72px;
text-align: center;
font: 12px/2 楷体,黑体,微软雅黑,宋体;
}
.navlist {
height: 36px;
line-height: 36px;
margin: 0 10px;
}
.nav li {
float: left;
display: inline;
margin: 0 0 0 -2px;
padding: 0 0px 0 0px;
}
.nav a {
display: block;
width: 93px;
text-align: center;
font-size: 140%;
font-weight:bold;
}
.nav a:link, .nav a:visited {
color: #fff;
}
.nav a.current, .nav a:hover, .nav a:active {
color: #fff;
font-weight: bold;
}
.subnav {
position: absolute;
top: 41px;
left: 0;
float: left;
height: 27px;
line-height: 27px;
white-space: nowrap;
}
* html .subnav {
margin: 0 10px 0 -10px; /* IE 6 and below */
}
.subnav p {
padding: 0 10px;
}
.subnav p span {
display: block;
}
.subnav p.pointer {
position: absolute;
top: -4px;
left: 0;
height: 5px;
width: 11px;
padding: 0;
margin-left:20px;
text-indent: -999em;
}
.subnav a {
display: inline;
padding: 0;
font-size: 125%;
}
[class~="subnav"] a {
padding: 0 3px;
}
.subnav, .subnav a:link, .subnav a:visited {
color: #235e99;
}
.subnav a:hover, .subnav a:active {
color: #235e99;
}
.subnav a:hover, .subnav a:active {
font-weight: normal;
background: none;
border-bottom: 2px solid;
}
/* subnav position and pointer position */
#subnav1 { left: 50px; }
#subnav2 { left: 170px; }
#subnav3 { left: 220px; }
#subnav4 { left: 450px; }
#subnav6 { left: 450px; }
#subnav5, #subnav7 {
left: auto;
right: 0px;
}
#subnav1 .pointer,
#subnav2 .pointer,
#subnav3 .pointer,
#subnav4 .pointer { left: 30px; }
#subnav5 .pointer { left: auto; right: 290px; }
#subnav6 .pointer { left: auto; right: 180px; }
#subnav7 .pointer { left: auto; right: 70px; }
#subnav1, #subnav2, #subnav3, #subnav4 {
min-width: 110px;
}
#subnav5 { min-width: 340px; }
#subnav6 { min-width: 240px; }
#subnav7 { min-width: 130px; }
以上是css
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="css/head.css" rel="stylesheet" type="text/css" />
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<script src="js/IE6_png.js" type="text/javascript"></script>
<script src="js/banner.js" type="text/javascript"></script>
<script src="js/new.js" type="text/javascript"></script>
</head>
<body>
<div class="head">
<div class="ln">
<div class="logo"></div>
<div class="navi">
<div class="navinner">
<ul class="nav">
<li><a href="Reserch_part1.html" target="main">首页</a></li>
<li><a href="ClassOverview_con.html" target="main" id="nav_0" onmouseover="showMenu('nav_0','subnav0')">关于我们</a>
<div class="subnav disable" id="subnav0">
<p class="pointer">.</p>
<p><span>
<a href="ClassOverview_con/JXDG_1.html" target=main>公司简介</a> |
<a href="ClassOverview_con/JGFA.html" target=main>企业文化</a> |
<a href="ClassOverview_con/KCTG.html" target=main>企业精神</a> |
<a href="ClassOverview_con/KCTG.html" target=main>技术力量</a>
</span></p>
</div>
</li>
<li><a href="TeacherTeam.html" target="main" id="nav_1" onmouseover="showMenu('nav_1','subnav1')">新闻动态</a>
<div class="subnav disable" id="subnav1">
<p class="pointer">.</p>
<p><span>
<a href="TeacherTeam/lianghua1.html" target=main>公司要闻</a> |
<a href="TeacherTeam/mainteacher.html" target=main>行业资讯</a> |
<a href="TeacherTeam/huangliyong.html" target=main>媒体聚焦</a> |
<a href="TeacherTeam/huangliyong.html" target=main>新闻报道</a> |
<a href="TeacherTeam/huangliyong.html" target=main>企业告示</a>
</span></p>
</div>
</li>
<li><a href="Teching_con.html" target="main" id="nav_2" onmouseover="showMenu('nav_2','subnav2')">产品展厅</a>
<div class="subnav disable" id="subnav2">
<p class="pointer">.</p>
<p><span>
<a href="teching_content/JXKJ.html" target=main>染料系列</a> |
<a href="teching_content/JXKJ.html" target=main>硫化黑系列</a> |
<a href="teching_content/JXKJ.html" target=main>海波系列</a> |
<a href="teching_content/YXZL.html" target=main>色酚系列</a> |
<a href="teching_content/YXZL.html" target=main>色酚系列</a>
</span></p>
</div>
</li>
<li><a href="Teching_src.html" target="main" id="nav_3" onmouseover="showMenu('nav_3','subnav3')">营销服务</a>
<div class="subnav disable" id="subnav3">
<p class="pointer">.</p>
<p><span>
<a href="Teching_src/XZWJ.html" target=main>在线留言</a> |
<a href="Teching_src/MuLuZiYuan.html" target="main">查看留言</a> |
<a href="ClassOverview_con/TechingCondition_con_part1.html" target="main">销售网络</a>|
<a href="ClassOverview_con/TechingCondition_con_part1.html" target="main">网上订购</a>|
<a href="ClassOverview_con/TechingCondition_con_part1.html" target="main">网上订购</a>
</span></p>
</div>
</li>
<li><a href="#" id="nav_6" onmouseover="showMenu('nav_6','subnav6')">人力资源</a>
<div class="subnav disable" id="subnav6">
<p class="pointer">.</p>
<p><span>
<a href="shijianpingtai/computerhomework.html" target="main">人才理念</a> |
<a href="#">人才招聘</a> |
<a href="#">商学院</a>
</span></p>
</div>
</li>
<li><a href="Reserch_part1.html" target="main">联系我们</a></li>
</ul>
</div>
以上是html
// JavaScript Document
function $(id) {
return document.getElementById(id);
}
function showMenu (baseID, divID) {
baseID = $(baseID);
divID = $(divID);
if (showMenu.timer) clearTimeout(showMenu.timer);
hideCur();
divID.style.display = 'block';
showMenu.cur = divID;
if (! divID.isCreate) {
divID.isCreate = true;
//divID.timer = 0;
divID.onmouseover = function () {
if (showMenu.timer) clearTimeout(showMenu.timer);
hideCur();
divID.style.display = 'block';
};
function hide () {
showMenu.timer = setTimeout(function () {divID.style.display = 'none';}, 1000);
}
divID.onmouseout = hide;
baseID.onmouseout = hide;
}
function hideCur () {
showMenu.cur && (showMenu.cur.style.display = 'none');
}
}
/*一流素材网www.16sucai.com*/
[解决办法]
你应该先让二级菜单隐藏起来,用css displya:none;