// nav function getScroll() { if ($(window).scrollTop() > 75) { $(".zd-top").addClass('header-fixed'); } else { $(".zd-top").removeClass('header-fixed'); } } getScroll(); $(window).scroll(function () { getScroll(); }); /* 导航菜单 */ function clearTouch(el, oStyle) { $(el).css('overflow', oStyle); $(el).on("touchmove", function(e) { e.preventDefault; }) } let oNavDom = $('.zd-nav').prop("outerHTML"); $('.navbar').click(function() { $('.mobile-nav').addClass('show-mobile'); $('.mobile-menu').append(oNavDom); clearTouch("body", "hidden") }) $('.close-btn').click(function() { $('.mobile-menu').empty(); $('.mobile-nav').removeClass('show-mobile'); clearTouch("body", "auto") }) $('.search-slide i').click(function () { $('.alert-search-box,.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(); }) var placetext = ""; $(".footer-form .input input,.footer-form .input textarea").focus(function(){ placetext = $(this).attr('placeholder'); $(this).attr('placeholder',""); }); $(".footer-form .input input,.footer-form .input textarea").blur(function(){ if($(this).val()==""){ $(this).attr('placeholder',placetext); } }); $("#gotop").bind("click",function(){ $('html, body').animate({scrollTop: 0},300); }); var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 0, mobile: true, live: true }); wow.init();