$(function() { $("a").focus(function() { this.blur(); }); $(".MainNav li").each(function(i, n) { if ($(this).find(".NavPull dd").length == 0) { $(this).find(".arr").hide(); $(this).find(".NavPull").addClass("null"); } }); // //搜索s $(".Header .Searchico").click(function() { $(".Header .searchbox").slideToggle(); $(this).toggleClass("on"); $(".MainNav").removeClass("on"); $(".closebtn").fadeOut("on"); $(".openbtn").removeClass("on"); }); //搜索end $(".openbtn").click(function() { $(this).toggleClass("on"); $(".MainNav").toggleClass("on"); $("body").toggleClass("bodyon"); $(".closebtn").slideToggle(0); }); // $(".closebtn").click(function() { $(".openbtn").removeClass("on"); $(".MainNav").toggleClass("on"); $("body").removeClass("bodyon"); $(".closebtn").slideToggle(0); }); // //$(window).scroll(function() { // if($(window).scrollTop()>=90){ // $(".Header").animate({marginTop:"-90px"},0); // }else{ // $(".Header").animate({marginTop:"0px"},0); // } // }); if ($(window).width() > 998) { $(".MainNav li").hover(function() { $(this).find(".NavPull").stop(true, true).delay(100).slideDown(); }, function() { $(this).find(".NavPull").stop(true, true).delay(100).slideUp(); }); //PC端下拉 } else { } if ($(window).width() < 998) { $(".MainNav li").each(function() { var Btn = $(this).find(".arr"); Btn.click(function() { var statis = $(this).parents("li").find(".NavPull").css("display"); if (statis == "none") { $(this).parents("li").siblings().removeClass("onnav"); $(this).parents("li").siblings().find(".NavPull").slideUp(); $(this).parents("li").addClass("onnav"); $(this).parents("li").find(".NavPull").slideDown(); } else { $(this).parents("li").find(".NavPull").slideUp(); $(this).parents("li").removeClass("onnav"); } }); }); } else { } //sj端下拉 $(".CaseList li, .HomeCulture li .box,.CaseList2 .box,.BrandList .box,.PhotoList li,.Process .imgbox,.ProList li,.NewsList li,.Pdfbox,.HornorList li .imgbox,.HomePro .leftimg .imgbox,.CaseList li a,.Contact3 .item .info,.Contact2").hover(function() { $(this).addClass("activehover"); }, function() { $(this).removeClass("activehover"); }); //滑过显示阴影效果 setTimeout(function() { $('.HomeNews .scroll:nth-child(2),.HomeNews .scroll:nth-child(3)').hide(); }, 200); tab_fuc($(".HomeNews .nav a"), $(".HomeNews .scroll"), 'on', 'mouseover'); function tab_fuc(list, cont, cls, trig) { list.first().addClass(cls); cont.first().show(); trig = trig ? trig : 'mouseover'; list.on(trig, function() { if (!$(this).hasClass(cls)) { list.removeClass(cls); $(this).addClass(cls); cont.stop(true, true).hide(); cont.eq($(this).index()).stop(true, true).fadeIn(400); $(window).resize(); } }); }; // $(".SubMenu .ColumnName").click(function() { $(this).parent().find("ul").slideToggle(); $(this).toggleClass("on"); }); //内页二级 $(".Footer .item").each(function() { var Btn = $(this).find(".arr"); Btn.click(function() { var statis = $(this).parents(".item").find(".sub").css("display"); if (statis == "none") { $(this).parents(".item").siblings().removeClass("on"); $(this).parents(".item").siblings().find(".sub").slideUp(); $(this).parents(".item").addClass("on"); $(this).parents(".item").find(".sub").slideDown(); } else { $(this).parents(".item").find(".sub").slideUp(); $(this).parents(".item").removeClass("on"); } }); }); //底部栏目 $(document).ready(function() { $('.gallery').each(function() { // the containers for all your galleries $(this).magnificPopup({ delegate: 'a', // the selector for gallery item type: 'image', gallery: { enabled: true } }); }); }); //弹出放大图层 $(".History .item").each(function(i, item) { if (Number(i + 1) % 2 == 0) { $(this).addClass("next"); } }); // $(".Joinbox2 .item").each(function(i, item) { if (Number(i + 1) % 2 == 0) { $(this).addClass("next"); } }); // $(".PrevNextBox dl").each(function() { var myhref = $(this).find("a").attr("href"); if (myhref == "#") { $(this).find("a").addClass("none"); $(this).find("a").removeAttr("href"); } }); //新闻详情 $(".FaqList .item").each(function() { var Btn = $(this).find(".thead"); Btn.click(function() { var statis = $(this).parents(".item").find(".info").css("display"); if (statis == "none") { $(this).parents(".item").siblings().removeClass("on"); $(this).parents(".item").siblings().find(".info").slideUp(500); $(this).parents(".item").addClass("on"); $(this).parents(".item").find(".info").slideDown(500); } else { $(this).parents(".item").find(".info").slideUp(500); $(this).parents(".item").removeClass("on"); } }); }); //常见问题 $(".TContent .TCItem").each(function() { var Btn = $(this).find(".TCItem_H"); Btn.click(function() { var statis = $(this).parents(".TCItem").find(".TCItem_C").css("display"); if (statis == "none") { $(this).parents(".TCItem").siblings().removeClass("current"); $(this).parents(".TCItem").siblings().find(".TCItem_C").slideUp(500); $(this).parents(".TCItem").addClass("current"); $(this).parents(".TCItem").find(".TCItem_C").slideDown(500); } else { $(this).parents(".TCItem").find(".TCItem_C").slideUp(500); $(this).parents(".TCItem").removeClass("current"); } }); }); //人才招聘 $(".SinglePage img").removeAttr("width").removeAttr("height"); $(".SinglePage img").parent("p span").css("text-indent", "0em"); $(".SinglePage img").parent("p").css("text-indent", "0em"); // var offset = 200, offset_opacity = 1200, scroll_top_duration = 1000, $back_to_top = $('.totop'); $(window).scroll(function() { ($(this).scrollTop() > offset) ? $back_to_top.addClass('cd-is-visible'): $back_to_top.removeClass('cd-is-visible'); }); $('.totop').click(function() { $('html,body').animate({ scrollTop: '0px' }, 800); }); //返回顶部 });