if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) { var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 0, mobile: false, live: true }); wow.init(); }; //wow引用 //整站无图处理 $.each($("img"), function (i, n) { $(n).on('error', function () { n.src = nopicpath; }); n.src = n.src; }); $(function(){ $("a").focus(function(){this.blur();}); $(".MainNav li").each(function (i, n) { if ($(this).find("dd").length == 0) { $(this).find(".arr").hide(); $(this).find(".NavPull").addClass("null"); } }); // //搜索s $(".Header .Searchico").click(function() { $(this).toggleClass("on"); $(".searchbox").toggleClass("on"); $(".MainNav,.openbtn ").removeClass("on"); $("body").removeClass("bodyon"); }); //搜索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); }); // $(".Header").hover(function(){ $(this).toggleClass("on"); }); $(window).scroll(function() { if($(window).scrollTop()>=1){ $(".Header").addClass("fix"); }else{ $(".Header").removeClass("fix"); } }); //滚动头部 if($(window).width()>1024){ $(".MainNav li").each(function () { var _this = $(this); _this.hover(function(){ _this.find(".NavPull").stop(true,true).delay(100).addClass("show"); _this.addClass("onnav").siblings().removeClass("onnav"); },function(){ _this.find(".NavPull").stop(true,true).delay(100).removeClass("show"); _this.removeClass("onnav"); $("#nav" + navID).addClass("onnav"); }); // }); //PC端下拉 }else{ $(".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"); } }); if($(this).hasClass("onnav")){ $(this).find(".NavPull").show(); } }); //sj端下拉 $(".SinglePage img").removeAttr("width").removeAttr("height"); // $(".ColName").click(function(){ $(this).parent().find("ul").slideToggle(); }); //内页二级 } $('.TabSlide').each(function () { var _this = $(this); _this.find(".TabCon:first").removeClass("nones").addClass("animated fadeIn"); _this.find(".TabNav .item").eq(0).addClass("on"); _this.find(".TabNav .item").on("mouseover", function () { var num = $(this).index(); $(this).addClass("on"); $(this).siblings().removeClass("on"); _this.find(".TabCon").addClass("nones").removeClass("animated fadeIn"); _this.find(".TabCon").eq(num).removeClass("nones").addClass("animated fadeIn"); }); }); //切换 $(".itemhover").hover(function(){ $(this).addClass("activehover"); },function(){ $(this).removeClass("activehover"); }); $(".itemhover2").hover(function(){ $(this).addClass("activehover2"); },function(){ $(this).removeClass("activehover2"); }); //滑过显示阴影效果 $(".Footer .select").each(function(){ var _this=$(this); _this.find("dt").click(function(){ $(this).addClass("on").parent().siblings().find("dt").removeClass("on"); $(this).next().slideToggle(); // _this.siblings().find("dd").slideUp(); }) }); $(document).bind("click", function(e) { var target = $(e.target); if (target.closest(".Footer .select dt").length == 0) { $(".Footer .select dd").slideUp(); $(".Footer .select dt").removeClass("on"); } }); //友情链接 $(window).scroll(function () { var scrollTop = $(window).scrollTop(); if($(".SubBan").length > 0){ $(".SubBan .img").css({"-webkit-transform": "translateY(" + scrollTop * 0.5 + "px)"}) } }); $(".SubBan").addClass("on"); if($(".SubMenu ul li").length==0){ $(".ColName i").hide(); } //内页BANNER $(".SinglePage p").each(function () { var $p = $(this); var $img = $p.find("img"); // 如果有 ,并且 src 不包含 icon_xls.gif if ($img.length > 0 && !$img.attr("src").includes("icon_xls.gif")) { $p.addClass("tc").css("text-indent", "0em"); } }); //新闻详情去除图片样式 if($(".styleList .item").length==0){ $(".styleList").addClass("nodata"); }; if($(".noticeList .item").length==0){ $(".noticeList").addClass("nodata"); }; if($(".infoList .item").length==0){ $(".infoList").addClass("nodata"); }; if($(".newsList .item").length==0){ $(".newsList").addClass("nodata"); }; 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'); var win_top = $(this).scrollTop(); var _top = $(".Footer .blank").offset().top; if (win_top >= _top) { $(".totop").addClass("fix"); } else { $(".totop").removeClass("fix"); } }); $('.totop').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);}); //返回顶部 $("a").each(function () { var htm = $(this).html(); $(this).click(function () { var res = $(this).hasClass("noTarget"); if (!res) { $(this).attr("target", "_blank"); } }); });//点击新窗打开 });