$(".products .side ul > li > .channel").click(function () { $(this).parent().siblings().removeClass("on"); $(this).parent().toggleClass("on"); }); $(".products .side ol > li > .channel > i").click(function () { $(this).parent().parent().siblings().removeClass("on"); $(this).parent().parent().toggleClass("on"); }); $(".products .side ol > li > .down > .channel > i").click(function () { $(this).parent().parent().siblings().removeClass("on"); $(this).parent().parent().toggleClass("on"); }); $(".products .side .title i").click(function () { $(this).toggleClass("on"); $(this).parent().next().slideToggle(); }); $(".footer .bd h3 i").click(function () { $(this).parent().parent().siblings().removeClass("on"); $(this).parent().parent().toggleClass("on"); }); $(".m_nav").click(function () { $(this).toggleClass("cross"); $(".ws-wap-menu").toggleClass("on"); }); $(".ws-wap-menu ul>li >i").click(function () { $(this).parent("li").siblings().removeClass("on"); $(this).parent("li").toggleClass("on"); }); $(".ws-wap-menu h4 i").click(function () { $(this).parent().parent().siblings().removeClass("on"); $(this).parent().parent().toggleClass("on"); }); $(".ws-wap-menu .dropdown ol li i").click(function () { $(this).parent().siblings().removeClass("on"); $(this).parent().toggleClass("on"); }); $(".dialog .close").click(function () { $(".mask").hide(); $(".dialog").hide(); }); $(".loginbtn").click(function () { $(".mask").show(); $(".dialog1").show(); }); $(".resterbtn").click(function () { $(".mask").show(); $(".dialog1").show(); }); $(".forget").click(function () { $(".password").show(); }); $(".tabtitle li").click(function () { //通过 .index()方法获取元素下标,从0开始,赋值给某个变量 var _index = $(this).index(); //让内容框的第 _index 个显示出来,其他的被隐藏 $(this) .parent() .next(".tabcontent") .find(".tabbox") .eq(_index) .show() .siblings() .hide(); //改变选中时候的选项框的样式,移除其他几个选项的样式 $(this).addClass("on").siblings().removeClass("on"); }); $(".totop").click(function () { $("body,html").animate({ scrollTop: 0 }, 500); return false; }); $(".header .dropdown .flex ol li a").on('mouseenter', function(){ $(this).parent().siblings().removeClass("on"); $(this).parent().toggleClass("on"); });