$('.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 bg-white shadow-sm'); } $(document).scroll(function(e) { scrollTop = document.documentElement.scrollTop || document.body.scrollTop; if (scrollTop > 0) { $('header').addClass('bg-white fixed-top shadow-sm page-active') }else{ $('header').removeClass('bg-white fixed-top shadow-sm page-active') } }) 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的Edge浏览器 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); });