<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{ padding: 0; margin: 0;}
li{ list-style-type: none;}
body{ margin: 50px; font-family:\5FAE\8F6F\96C5\9ED1,'Arial';}
a{ text-decoration: none; color:#f00;}
h3{ cursor: pointer;}
</style>
</head>
<body>
<h3>导航一</h3>
<ul style="display:none">
<li><a href="#">11111</a></li>
<li><a href="#">11111</a></li>
<li><a href="#">11111</a></li>
<li><a href="#">11111</a></li>
</ul>
<h3>导航二</h3>
<ul style="display:none">
<li><a href="#">22222</a></li>
<li><a href="#">22222</a></li>
<li><a href="#">22222</a></li>
<li><a href="#">22222</a></li>
</ul>
<h3>导航三</h3>
<ul style="display:none">
<li><a href="#">33333</a></li>
<li><a href="#">33333</a></li>
<li><a href="#">33333</a></li>
<li><a href="#">33333</a></li>
</ul>
<script src="jquery.js"></script>
<script src="jquery.easing.1.3.js"></script>
<script>
$(function(){
$.easing.def = 'easeOutElastic';
var oBtn = $('h3');
oBtn.click(function(){
$(this).next('ul').slideToggle().siblings('ul').slideUp();
});
});
</script>
</body>
</html>
效果图:
标签:function,oBtn,11111,折叠,JQ,22222,导航,33333 From: https://blog.51cto.com/u_16171388/6557090