web前端–下拉菜单(jquery版)
这个要注意一下每次动画调用前记得.stop()一下。可以解决动画队列问题。
效果图入下
代码实现:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="//libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<style>
*{
margin: 0;
padding: 0;
}
.nav{
list-style:none;
width: 300px;
height: 50px;
background: red;
margin: 100px auto;
}
.nav>li{
width: 100px;
height: 50px;
line-height: 50px;
text-align: center;
float: left;
}
.sub{
list-style:none;
background: mediumpurpl