标签:style nbsp ddc remove play function move lis 点击
监听的事件具体,这样不会联动
<ul>
<li class="two">
<a><h3>啦啦啦</h3></a>
<ul class="three">
<li class="five">啦啦啦</li>
<li class="five">啦啦啦</li>
<li class="five">啦啦啦</li>
</ul>
</li>
<li class="two">
<a><h3>哦哦哦</h3></a>
<ul class="three">
<li class="five">啦啦啦</li>
<li class="five">啦啦啦</li>
<li class="five">啦啦啦</li>
</ul>
</li>
</ul>
<style>
li {
list-style: none;
}
.active {
color: blue;
}
.activee {
color: red;
}
.three {
display: none;
}
</style>
主要代码内容
<script>
$(‘.two>a‘).click(function () {
$(this).parent().addClass(‘active‘).siblings().removeClass(‘active‘);
var three = $(this).parent().find(‘ul‘);
if (three.css(‘display‘) == ‘none‘) {
three.show();
}else {
three.hide();
}
});
$(‘.five‘).click(function (){
$(this).addClass(‘activee‘).siblings().removeClass(‘activee‘);
})
</script>
标签:style nbsp ddc remove play function move lis 点击
原文地址:http://www.cnblogs.com/qinjisong/p/6956933.html