$(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); }); //返回顶部 });