JQuery点击弹出与收回事件(加号变减号)
很久没有与大家分享了,这是一个很简单的效果,look……
<ul class="moddle f-cb"> <li class="boun"><a href="javascript:void(0);">【搜索提交模板】<span class="jia">+</span></a> <ul class="moddle-1"> <li><a href="#">【搜索提交模板】</a></li> <li><a href="#">【搜索提交模板】</a></li> <li><a href="#">【搜索提交模板】</a></li> </ul></li> <li class="boun"><a href="javascript:void(0);">【搜索提交模板】<span class="jia">+</span></a> <ul class="moddle-1"> <li><a href="#">【搜索提交模板】</a></li> <li><a href="#">【搜索提交模板】</a></li> <li><a href="#">【搜索提交模板】</a></li> </ul></li> <li class="boun"><a href="javascript:void(0);">【搜索提交模板】<span class="jia">+</span></a> <ul class="moddle-1"> <li><a href="#">【搜索提交模板】</a></li> <li><a href="#">【搜索提交模板】</a></li> <li><a href="#">【搜索提交模板】</a></li> </ul> </li> <li class="boun"><a href="javascript:void(0);">【搜索提交模板】<span class="jia">+</span></a> <ul class="moddle-1"> <li><a href="#">【搜索提交模板】</a></li> <li><a href="#">【搜索提交模板】</a></li> <li><a href="#">【搜索提交模板】</a></li> </ul></li> </ul>
js代码在这里:
$(document).ready(function(){ $(".boun>a").click(function(){ var ulNode = $(this).next("ul"); if(ulNode.css("display")=="none"){ ulNode.css("display","block") $(".jia",this).html("<span>-</span>"); }else{ ulNode.css("display","none") $(".jia",this).html("<span>+</span>"); } //ulNode.slideToggle() }); });
相关推荐
84483065 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
tztzyzyz 2020-07-05
delmarks 2020-06-28
89510194 2020-06-27
牵手白首 2020-06-14
tztzyzyz 2020-05-31
81463166 2020-05-17
88570299 2020-05-17
delmarks 2020-05-17
donghongbz 2020-05-15
tztzyzyz 2020-05-15
<table id="table" class="table table-striped table-bordered table-hover table-nowrap" width="100%&qu
牵手白首 2020-05-14
Chriswang 2020-04-30
83510998 2020-05-03