码迷,mamicode.com
首页 > 其他好文 > 详细

navLI鼠标滑上显示下拉导航

时间:2016-09-10 16:12:01      阅读:102      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!