$('.top-menu-list').on('click', 'a', function (e) { var $this = $(this) if ($this.next().length > 0) { $this.closest('.top-menu-list').addClass('active') $this.next().addClass('active').parent().siblings().find('.active').removeClass('active') } if ($this.find('.icon-left').length > 0) { $this.closest('.top-menu-list').removeClass('active') } }) $(document).ready(function () { wow = new WOW({ animateClass: 'animated' }); wow.init(); }) $('.menu-container-mask').click(function () { $(this).css('left', '100%'); $(this).find('.top-menu-list').removeClass('active'); }) $('header .menu').click(function () { $('.header-menu-container-mask.menu-container-mask').css('left', '0'); }) if ($('.menu-list').length > 0) { $('.menu-list').on('click', '.item>a', function (e) { if ($(this).parent().find('.cell a').length > 0) { e.stopPropagation(); e.preventDefault(); var $li = $(this).closest('li'); if ($li.hasClass('active')) { $li.removeClass('active') } else { $li.addClass('active').siblings('.active').removeClass('active') } } }) } $('header .head-nav>ul>li').hover(function () { $(this).find('.son-nav').addClass('active'); $(this).find('.pro-son-nav').addClass('active'); $('header').addClass('head-bg'); }, function () { $('header').removeClass('head-bg'); $(this).find('.son-nav').removeClass('active'); $(this).find('.pro-son-nav').removeClass('active'); }) var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; if (scrollTop > 0) { $('header').addClass('active shadow-sm fixed-top'); } $(document).scroll(function (e) { scrollTop = document.documentElement.scrollTop || document.body.scrollTop; if (scrollTop > 0) { $('header').addClass('active shadow-sm fixed-top') } else { $('header').removeClass('active shadow-sm fixed-top') } }) function IEVersion() { var userAgent = navigator.userAgent; //鍙栧緱娴忚鍣ㄧ殑userAgent瀛楃涓 var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //鍒ゆ柇鏄惁IE<11娴忚鍣 var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //鍒ゆ柇鏄惁IE鐨凟dge娴忚鍣 var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; if (isIE) { var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); reIE.test(userAgent); var fIEVersion = parseFloat(RegExp["$1"]); if (fIEVersion) { var updateUrl = location.protocol + '//' + location.host + '/browser'; location.href = updateUrl; } } else if (isIE11) { var updateUrl = location.protocol + '//' + location.host + '/browser'; location.href = updateUrl; } } IEVersion() $(".f-top").click(function () { $('body,html').animate({ scrollTop: 0 }, 300); });