jQuery 复习之折叠菜单 简洁代码
<html>
<head>
<script src='js/min.js'></script>
<script src='js/menu.js'></script>
</head>
<body>
<ul class="m-treeview">
<li class="m-expanded">
<span>衬衫</span>
<ul>
<li><span>短袖衬衫</span></li>
<li><span>长袖衬衫</span></li>
</ul>
</li>
<li class="m-expanded">
<span>卫衣</span>
<ul>
<li ><span>开襟卫衣</span></li>
<li ><span>套头卫衣</span></li>
</ul>
</li>
</ul>
</body>
</html>
$(function(){
$('.m-expanded span').click(function(){
$(this).siblings('ul').toggle();
});
})
补充:web前端 , JavaScript ,