$(window).scroll(function(e) { let oScroll = $(document).scrollTop(); if (oScroll > 60) { $(".header-box").addClass('active-header'); $("#gotop").addClass('gotop-active'); } else { $(".header-box").removeClass('active-header'); $("#gotop").removeClass('gotop-active'); } }); /*导航菜单*/ function clearTouch(el, oStyle) { $(el).css('overflow', oStyle); $(el).on("touchmove", function(e) { e.preventDefault; }) } $('.navbar').click(function() { $('.mobile-alert').addClass('active-mobile-alert'); $('.mobile-box').addClass('active-mobile-box'); clearTouch("body", "hidden") }) $('.mobile-close').click(function() { $('.mobile-alert').removeClass('active-mobile-alert'); $('.mobile-box').removeClass('active-mobile-box'); clearTouch("body", "auto"); }) // lang function openLang() { $('.alert-lang-box').addClass('alert-lang-show'); $('.alert-lang').addClass('alert-lang-show'); } $('.close-alert-lang,.alert-lang').click(function() { $('.alert-lang-box ,.alert-lang').removeClass('alert-lang-show'); }) $('.alert-lang').click(function() { $('.alert-lang-box ,.alert-lang').removeClass('alert-lang-show'); }) $('.alert-lang-box').click(function(e) { e.stopPropagation(); }) // search $('.header-search').click(function() { $('.alert-search-box').addClass('alert-search-show'); $('.alert-search').addClass('alert-search-show'); }) $('.close-alert-search').click(function() { $('.alert-search-box ,.alert-search').removeClass('alert-search-show'); }) $('.alert-search').click(function() { $('.alert-search-box ,.alert-search').removeClass('alert-search-show'); }) $('.alert-search-box').click(function(e) { e.stopPropagation(); }) let wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 150, mobile: true, live: true }); wow.init(); function returnTop(){ $('body,html').animate({scrollTop:0},1000); } // function mycheckWidth() { // let html = []; // let papeWidth = $(window).width(); // if ($(".checkWidth")) { // $(".checkWidth").remove() // } // html = // '
' + // papeWidth + '
'; // $("body").append(html) // } // mycheckWidth() // $(window).resize(function() { // mycheckWidth() // })