下拉菜单

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}

ul {
list-style: none;
}

.wrap {
width: 330px;
height: 30px;
margin: 100px auto 0;
padding-left: 10px;
background-image: url(images/bg.jpg);
}

.wrap li{
background-image: url(images/libg.jpg);
}

.wrap > ul > li {
float: left;
margin-right: 10px;
position: relative;
}

.wrap a {
display: block;
height: 30px;
width: 100px;
text-decoration: none;
color: #000;
line-height: 30px;
text-align: center;
}

.wrap li ul {
position: absolute;
top: 30px;
display: none;
}

</style>
<script src="jquery-1.12.2.js"></script>
<script>
$(function(){
  $(".wrap>ul>li").mouseover(function(){
    $(this).children("ul").stop().show(500);
  });
  $(".wrap>ul>li").mouseout(function(){
    $(this).children("ul").stop().hide(500);
  });
});
</script>
</head>
<body>
<div class="wrap">
<ul>
<li>
<a href="javascript:void(0);">帅哥系列</a>
<ul>
<li><a href="javascript:void(0);">乔峰</a></li>
<li><a href="javascript:void(0);">张无忌</a></li>
<li><a href="javascript:void(0);">郭靖</a></li>
</ul>
</li>
</ul>
</div>
</body>
</html>

posted @ 2020-04-08 20:11  花木兰r  阅读(110)  评论(0编辑  收藏  举报