var open = false; var windowWidth, windowHeight, windowScrollTop, ua = navigator.userAgent.toLowerCase(), isChrome = -1 < ua.indexOf("chrome"), isIEs = 0 < ua.indexOf("msie") || !!navigator.userAgent.match(/Trident\/7\./), isEdge = 0 < ua.indexOf("edge"), isFirefox = "undefined" != typeof InstallTrigger, isAndroid = $(".android").length, isIOS = $(".ios").length, isMobile = $(".mobile").length, isTouch = "ontouchstart" in document.documentElement, isTablet = $(".tablet").length, $window = $(window), $html = $("html"), $body = $("body"), clickEvent = isMobile ? "touchend": "click", resizeEvent = "orientationchange" in window ? "orientationchange": "resize", animationEnd = "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", transitionEnd = "webkitTransitionEnd MSTransitionEnd otransitionend transitionend"; animateOnScroll = function() { var i; return { init: function() { AOS.init({ once: !0, offset: 70, duration: 1100, easing: "cubic-bezier(0.2, 1, 0.3, 1)" }), isIEs || isEdge || (function() { if (!$(".rellax").length) return; { var t; "js-desktop" == jsQueryTest.getCurrentState() && (t = new Rellax(".rellax", { callback: function(e) { $(".rellax").addClass("rellax-init"), i && clearTimeout(i), i = setTimeout(function() { var e; "js-desktop" !== jsQueryTest.getCurrentState() && (t.destroy(), $(".rellax").removeClass("rellax-init"), e = null, $(window).on("resize.reinitRellax", function() { e && clearTimeout(e), e = setTimeout(function() { "js-desktop" == jsQueryTest.getCurrentState() && ($(".rellax").hasClass("rellax-init") || (t.refresh(), $(window).off("resize.reinitRellax"))) }, 50) })) }, 50) } })) } } (), "function" == typeof SmoothScroll && SmoothScroll({ animationTime: 300, stepSize: 60, accelerationDelta: 30, accelerationMax: 2, keyboardSupport: !0, arrowScroll: 50, pulseAlgorithm: !1, pulseScale: 4, pulseNormalize: 1, touchpadSupport: !1, fixedBackground: !1, excluded: "" }), document.addEventListener("aos:in", function(e) { var t = $(e.detail.detail).add(e.detail); 0 < t.closest(".tab-pane:not(.active)").length && t.removeClass("aos-init aos-animate"), 0 < t.closest(".collapse:not(.show)").length && t.removeClass("aos-init aos-animate"), 0 < t.closest(".dropdown-menu:not(.show)").length && t.removeClass("aos-init aos-animate") })) } } } (); function setTabs($div_info) { $div_info.on("mouseover",function(){ $(this).addClass("cur").siblings().removeClass("cur"); var index = $div_info.index(this); $(this).parent().prev(".index-cons").find(".index-con").eq(index).show().siblings().hide(); $(this).parent().next(".index-cons").find(".index-con").eq(index).show().siblings().hide(); }); } $(function () { $(".nav-menu > li").hover(function() { var $container = $(this), $list = $container.find(".sub-nav"); $list.slideDown(500); }, function() { var $el = $(this); $el.find(".sub-nav") .hide() .end(); }); $(".header .header-m").on("click",function(){ $(".header-r .sub-nav").hide(); $(".header-nav").slideToggle(250); }); $(".header-r .mark").on("click",function(){ $(this).parent().siblings().find(".sub-nav").hide(); $(this).parent().siblings().removeClass("cur"); $(this).siblings(".sub-nav").slideToggle(250); if($(this).siblings(".sub-nav").css("display") == "block") { $(this).parent().addClass("cur"); } else { $(this).parent().removeClass("cur"); } }); $(".page-side-title").on("click",function(){ $(".page-con-class").slideToggle(350); }); $(".search-submit").click(function(event) { //$(this).removeAttr("name"); //event.preventDefault(); var val = $.trim($(".search-title").val()); if(val!==""){ return true; }else{ alert("请输入关键词"); return false; } }); $(".wx1").click(function(){ var html = $('#wx').html(); layer.open({ type: 1, title: false, closeBtn: 1, area: '135px', shadeClose: true, content:html }); }); if($(window).width()> 767){ window.onscroll = function(){ var zhead = $(".header").height() + 5; //获取头部高度 var sTop = $(document).scrollTop(); //滚动事件 if( parseInt(sTop) > zhead){ //触发条件,显示返回顶部按钮,可使用数 $(".gotop").show(); }else { $(".gotop").fadeOut(800); } $(".gotop").on("click",function(){ //滚动速度 $("body,html").stop().animate({scrollTop:0}, 800); }); if(window.screen.width <= 768){ //判断分辨 $(".gotop").remove(); } } } });