日期:2014-05-17  浏览次数:20957 次

请问各位大侠下拉菜单怎么做?
请问各位大侠下拉菜单怎么做?现在的网站一般都采用下拉式菜单,鼠标一放上去就会显示下拉菜单,请问各位大侠,这个是怎么实现的?望各位指教

------解决方案--------------------
原理大概如下,就是设置style.visibility和z-index实现隐藏,通过mouseover,mouseout实现显示。好像Dream什么的有相关编辑工具。

菜单要用脚本,会降低网站通用性,还严重影响浏览,最好不用。

<head>
<style>
.cssMenuBar{width:200; height:20; color:blue; background:menu; cursor:hand; font-size:10pt;}
.cssMenu{position:absolute; visibility:hidden; z-index:1; width:200; height:100; color:blue; background:menu; cursor:hand; font-size:10pt;}
</style>
</head>
<body>
<div>
<div id= "htmMenuBar " class= "cssMenuBar " > 放在我上面! </div>
<div id= "htmMenu " class= "cssMenu ">
这是 <br> 菜单
</div>
</div>
aefasdfefazxcvzxcvz
</body>

<script language= "vbs ">
Sub htmMenuBar_onMouseOver()
Window.event.srcelement.ParentElement.children(1).style.visibility= "visible "
End Sub

Sub htmMenuBaronMouseOut()
Window.event.srcelement.ParentElement.children(1).style.visibility= "hidden "
End Sub

Sub htmMenu_onMouseOver()
Window.event.srcelement.ParentElement.children(1).style.visibility= "visible "
End Sub

Sub htmMenu_onMouseOut()
Window.event.srcelement.ParentElement.children(1).style.visibility= "hidden "
End Sub

</script>