js遍历添加栏目类添加css 再点击其它删除css【推荐】
具体代码如下:
//js遍历添加栏目类添加css 再点击其它删除css $(".radio-group .ckselect").each(function(index) { $(this).click(function() { var tagid=$(this).attr('tagid'); $("#tagid").val(tagid) $(".ckselect").removeClass("selected"); $(".ckselect").eq(index).addClass("selected") }) });
//js点击显示关闭层,空白区域也关闭 $(".zu-top-nav-userinfo").click(function(e) { if ($(".peoples").hasClass("allhide")) { $(".peoples").hide(); $(".peoples").removeClass("allhide"); return } e.stopPropagation(); $(".peoples").show(); $(".peoples").addClass("allhide") }); $(document).click(function() { if ($(".peoples").hasClass("allhide")) { $(".peoples").hide(); $(".peoples").removeClass("allhide") } });
总结
相关推荐
NARUTOLUOLUO 2020-08-03
qiupu 2020-11-04
多读书读好书 2020-11-03
RedCode 2020-10-28
jiedinghui 2020-10-25
Ladyseven 2020-10-22
hellowzm 2020-10-12
zuncle 2020-09-28
Ladyseven 2020-09-11
jiedinghui 2020-09-07
xiaohuli 2020-09-02
葉無聞 2020-09-01
impress 2020-08-26
ThikHome 2020-08-24
nicepainkiller 2020-08-20
hellowzm 2020-08-18