/*婊氬姩鍔ㄧ敾*/ function scrollAni(ele,_distance) { ele.each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { // _this.removeClass('animate'); } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * _distance) { _this.addClass('animate'); } }); $(window).scroll(function() { ele.each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { // _this.removeClass('animate'); } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * _distance) { _this.addClass('animate'); } }); }); } function visual_button_scroll_down(ele){ ele.each(function(){ $(this).on('click',function(){ var target = $(this).attr('href'); var target_top = $(target).offset().top; $('html,body').animate({ scrollTop : target_top },1000, 'easeInOutQuad'); return false; }); }) } function _showToTop() { var h = $(window).height(); if($(window).scrollTop()>h/3) { $('.toTop').stop().fadeIn(); $('.right-fixed').addClass('animate'); }else { $('.toTop').stop().fadeOut(); $('.right-fixed').removeClass('animate'); } } $('.slideDown').click(function(){ var _size = $('.welcome').size(); if(_size<1) { console.log(1) $("html,body").animate({"scrollTop": $('#list1').offset().top}, "slow"); } }) //灏戜簬鎸囧畾杞挱涓暟锛岄殣钘忕偣鐐圭偣 function hide_Swiper_Hd(el1,el2,width,size) { var _s = el1.size(); var _w = $(window).width(); if(_w > width && _s < size) { el2.css('display','none'); } } function hide_Swiper_Hd2(el1,el2,size) { var _s = el1.size(); if(_s < size) { el2.css('display','none'); } } function _innerBanner() { if($('.inner-banner').length>0) { var _innerPcImg = $('.inner-banner .bgImg').data('src'); var _innerMImg = $('.inner-banner .m-banner-img').attr('src'); var arrayimg2 = []; arrayimg2.push(_innerPcImg,_innerMImg); _PreLoadImg(arrayimg2,function(){ $('.inner-banner').find('.loaddings').fadeOut(50); $('.inner-banner').addClass('animate'); $('.inner-banner .bgImg').attr("style","background-image:url("+_innerPcImg+")"); }); // _headerBg(); // $(window).scroll(function(){ // _headerBg(); // }); } } _innerBanner(); // 澶村簳鍙婂叕鍏卞嚱鏁 $(function(){ wow = new WOW( { boxClass: 'wow', // default animateClass: 'animated', // default offset: 100, // default 0 mobile: true, // default live: true // default }); wow.init(); // innerBanner(); scrollAni($('.js-m'),.88); $('.header').addClass('animate'); _showToTop(); $(window).scroll(function(){ _showToTop(); }); $('.toTop').click(function(){ $("html,body").animate({"scrollTop": "0px"}, "slow"); }); // getHref(); });