首页 > 其他 > 详细

navLI鼠标滑上显示下拉导航

时间:2016-09-10 16:09:58      阅读:146      评论:0      收藏:0      [点我收藏+]

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>li导航</title>
<style type="text/css">
*{padding: 0;margin: 0;}
#box{width: 100%;background: red;height: 50px;margin: 0 auto;position: relative;min-width: 500px;}
#list{margin: 0 400px;min-width: 500px;}
#list li{list-style: none;float: left;padding: 10px;background: paleturquoise;cursor: pointer;
}
#hide{width: 86px;height: 150px;background: blueviolet;position: absolute;top: 39px;
left: 451px;display: none;}
#hide ul li{list-style: none;text-align: center;width: 67px;height: 38px; line-height: 38px;}
</style>
<script type="text/javascript" src="js/jquery.js" ></script>

</head>
<body>
<div id="box">
<ul id="list">
<li>首页</li>
<li id="pro">产品列表


</li>
<li>活动介绍</li>
<li>联系我们</li>

</ul>
<div id="hide">
<ul >
<li>首页</li>
<li>表头</li>
<li>首页</li>
<li>首页</li>
</ul>
</div>
</div>

<script type="text/javascript">
$(function(){
var pro = document.getElementById("pro");
var hide = document.getElementById("hide");

pro.onmouseover = function(ev){
var ev = ev || event;
hide.style.display = ‘block‘;
ev.cancelBubble = ‘true‘;

}
hide.onmouseover = function (ev){
var ev = ev || event;
ev.cancelBubble = ‘true‘;
}

document.onmouseover = function (){
hide.style.display = ‘none‘;
}

})
</script>
</body>
</html>

navLI鼠标滑上显示下拉导航

原文:http://www.cnblogs.com/qiyc/p/5859423.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!