请问ecshop中如何实现导航栏上将鼠标放在上面就显示下面有二级导航的效果?
展开全部
<script language="javascript">
function show(a) {
var d,n=10;
for (var i=1;i<=n;i++) {
d=document.getElementById("myDiv"+i);
d.style.display=(i==a)?"":"none";
}
}
</script>
<style>
.abc{cursor:hand;color:#f00;}
#topmenu ul{display:inline; margin-left:0px;}
#topmenu ul li{
height:30px;
display:inline;
padding-left:8px;
margin:2px;
list-style-type: none;
}
#topmenu ul li a{color:#000;text-decoration: none;}
#topmenu ul li a:hover{color:#f00;}
</style>
<div id="topmenu">
<ul>
<div>
<%For i=1 to 10%>
<li onmouseover="javascript:show(<%=i%>)"><a href="#">编号[<%=i%>]</a></li>
<%Next%>
</ul>
<%For i=1 to 10%>
<div id="myDiv<%=i%>" style="display:none;border:1px solid #ccc">点击编号[<%=i%>]后显示的文字</div>
<%Next%>
</div>
function show(a) {
var d,n=10;
for (var i=1;i<=n;i++) {
d=document.getElementById("myDiv"+i);
d.style.display=(i==a)?"":"none";
}
}
</script>
<style>
.abc{cursor:hand;color:#f00;}
#topmenu ul{display:inline; margin-left:0px;}
#topmenu ul li{
height:30px;
display:inline;
padding-left:8px;
margin:2px;
list-style-type: none;
}
#topmenu ul li a{color:#000;text-decoration: none;}
#topmenu ul li a:hover{color:#f00;}
</style>
<div id="topmenu">
<ul>
<div>
<%For i=1 to 10%>
<li onmouseover="javascript:show(<%=i%>)"><a href="#">编号[<%=i%>]</a></li>
<%Next%>
</ul>
<%For i=1 to 10%>
<div id="myDiv<%=i%>" style="display:none;border:1px solid #ccc">点击编号[<%=i%>]后显示的文字</div>
<%Next%>
</div>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询