这个样子的菜单要怎么弄? 本帖最后由 nply2008 于 2011-03-11 11:35:52 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这菜单有特别之处 ? div css ~~~ <head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><script type="text/javascript"><!--//--><![CDATA[//><!--startList = function() {if (document.all&&document.getElementById) {navRoot = document.getElementById("menu");var allli = navRoot.getElementsByTagName("li")for (i=0; i<allli.length; i++) {node = allli[i];node.onmouseover=function() {this.className+=" current";}node.onmouseout=function() {this.className=this.className.replace(" current", "");}}}}window.onload=startList;//--><!]]></script><style type="text/css">body { font-family: Verdana; font-size: 12px; line-height: 1.5; }#menu a { color: #000; text-decoration: none; }#menu a:hover { color: #F00; }#menu ul { list-style: none; margin: 0px; padding: 0px; }#menu ul li { display: inline;background: #eee; padding: 0px 8px; height: 26px; line-height: 26px; border: 1px solid #CCC; position:relative; }#menu ul li ul { display:none; position: absolute; left:-1px; top: 28px; width:100px; border:0px solid #ccc; border-bottom:none; z-index:65535;}#menu ul li.current ul { display:block;}#counter{ width:124px;height:135px;}</style></head><body><div id="menu"><ul><li><a href="#" onmouseout="change()">计算器</a><ul><li>111111111111</li><li>222222222222</li><li>333333333333</li><li>444444444444</li></ul></li></ul></div>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</body> <style type="text/css"> #buy{width:200px;height:50px;float:left;text-align:center;padding-top:15px;} #hr{width:200px;height:50px;float:left;text-align:center;padding-top:15px;margin-left:5px;} #vc{width:200px;height:50px;float:left;text-align:center;padding-top:15px;margin-left:5px;} </style> <script type="text/javascript"> function show3() { window.document.getElementById("hidden").style.display="block"; } function hiddenshow3() { window.document.getElementById("hidden").style.display="none"; } </script> </HEAD> <BODY> <div style="width:650px;height:50px;background-color:blue"> <div id="buy">网上采购</div> <div style="width:5px;height:40px;background-color:red;margin-top:5px;float:left;"></div> <div id="hr">人力资源</div> <div style="width:5px;height:40px;background-color:red;margin-top:5px;float:left;"></div> <div id="vc" onmouseover="show3()" onmouseout="hiddenshow3()">视频中心</div> </div> <div id="hidden" style="width:200px;height:60px;background-color:red;margin-left:420px;display:none"> <div>a</div> <div>b</div> <div>c</div> </div>其实这样的菜单栏可以有很多种做法,就看你怎么弄了。看我的可以给你参考一下不? 求助,js在ie6和ie7下有问题!! ........! 关于滚动条和抬头的问题 求最少化代码 想请教下,JS中除了<bgsound>和<embed>外有没有其它能动态控制声音或播放音乐的方法? 在线急等。怎么实现ppt个实在网页中的显示? 多文件上传的表单 关于字符串的问题 ToolTip/Title问题,敬请指教。 javascript问题:如何得到input type="radio" 的值? 在JavaScript中如何截获父窗口中的事件 请大虾拔刀相助 我把全部积蓄(20)都给你!!! 新手的jQuery問題,當使用for時 我这句JS怎么改才能达到效果???
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script type="text/javascript"><!--//--><![CDATA[//><!--
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("menu");
var allli = navRoot.getElementsByTagName("li")
for (i=0; i<allli.length; i++) {
node = allli[i];
node.onmouseover=function() {
this.className+=" current";
}
node.onmouseout=function() {
this.className=this.className.replace(" current", "");
}
}
}
}
window.onload=startList;
//--><!]]></script>
<style type="text/css">
body { font-family: Verdana; font-size: 12px; line-height: 1.5; }
#menu a { color: #000; text-decoration: none; }
#menu a:hover { color: #F00; }
#menu ul { list-style: none; margin: 0px; padding: 0px; }
#menu ul li { display: inline;background: #eee; padding: 0px 8px; height: 26px; line-height: 26px; border: 1px solid #CCC; position:relative; }
#menu ul li ul { display:none; position: absolute; left:-1px; top: 28px; width:100px; border:0px solid #ccc; border-bottom:none; z-index:65535;}
#menu ul li.current ul { display:block;}#counter{ width:124px;height:135px;}
</style>
</head>
<body>
<div id="menu">
<ul>
<li><a href="#" onmouseout="change()">计算器</a>
<ul>
<li>
111111111111
</li>
<li>
222222222222
</li>
<li>
333333333333
</li>
<li>
444444444444
</li>
</ul>
</li>
</ul>
</div>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
</body>
#buy{width:200px;height:50px;float:left;text-align:center;padding-top:15px;}
#hr{width:200px;height:50px;float:left;text-align:center;padding-top:15px;margin-left:5px;}
#vc{width:200px;height:50px;float:left;text-align:center;padding-top:15px;margin-left:5px;}
</style>
<script type="text/javascript">
function show3()
{
window.document.getElementById("hidden").style.display="block";
}
function hiddenshow3()
{
window.document.getElementById("hidden").style.display="none";
}
</script>
</HEAD> <BODY>
<div style="width:650px;height:50px;background-color:blue"> <div id="buy">网上采购</div>
<div style="width:5px;height:40px;background-color:red;margin-top:5px;float:left;"></div>
<div id="hr">人力资源</div>
<div style="width:5px;height:40px;background-color:red;margin-top:5px;float:left;"></div> <div id="vc" onmouseover="show3()" onmouseout="hiddenshow3()">视频中心</div>
</div>
<div id="hidden" style="width:200px;height:60px;background-color:red;margin-left:420px;display:none">
<div>a</div>
<div>b</div>
<div>c</div>
</div>
其实这样的菜单栏可以有很多种做法,就看你怎么弄了。看我的可以给你参考一下不?