$(document).ready(function(e) { //首页banner // $('.home_bd').bxSlider({auto: true,mode: 'fade'}); $('.pic_bd').bxSlider({auto: true,mode: 'fade'}); $(".about .con i").click(function(){ $(".tan_video").fadeIn(); $(".back_bg").fadeIn(); }) $(".back_bg").click(function(){ $(".tan_video").fadeOut(); $(".back_bg").fadeOut(); }) var _thischild = $("#leftcontrol #nav .active .subnav"), _thischildheight = (_thischild.children("li").length)*50; _thischild.height(_thischildheight); $(".hassub").on("click",function(){ var _this = $(this), _parent = _this.parent(), _height = (_parent.find(".subnav").children("li").length)*50; if(_parent.hasClass("active")){ _parent.removeClass("active"); _parent.find(".subnav").height(0); }else{ $(".child").removeClass("active"); $(".child").find(".subnav").height(0); _parent.addClass("active"); _parent.find(".subnav").height(_height); } }) $("#openlc").on("click",function(){ var _body = $("body"); if(_body.hasClass("open")){ _body.removeClass("open"); }else{ _body.addClass("open"); $("#bgmask").show(); } }) $("#bgmask").on("click",function(){ $("body").removeClass("open"); $("#bgmask").hide(); }); $("#yearbtn").on("click",function(){ if($("#articleBox").hasClass("open")){ $("#articleBox").removeClass("open") }else{ $("#articleBox").addClass("open") } }) var _btn = $(".contact .public_traffic .fa"); _btn.click(function(){ if($(this).parent().hasClass("open")) { $(this).parent().removeClass("open"); $(this).parent().addClass("close"); }else{ $(this).parent().removeClass("close"); $(this).parent().addClass("open"); } }) });