function scrollAnimation2(ele) { $(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() * 0.9) { _this.addClass('animate'); setInterval(function(){ $("body").addClass("avh0"); },50) // _this.find(".k10 .ul").addClass('animate'); _this.find(".loading-sw").remove(); } }); $(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() * 0.9) { // console.log($(window).scrollTop() ,_this.offset().top - $(window).height() * 0.8) _this.addClass('animate'); // _this.find(".k10 .ul").addClass('animate'); _this.find(".loading-sw").remove(); } }); }); } function Remove(ele){ $(ele).contents().filter(function() { return this.nodeType === 3; }).remove(); } Remove(".pagination,.kh") scrollAnimation2($('.secwen')); function visual_button_scroll_down(){ $(".itgbox .swiper-slide").each(function(){ $(this).on('click',function(){ var target = $(this).find("a").attr('href'); var target_top = $(target).offset().top-64; $('html,body').animate({ scrollTop : target_top },1500, 'easeInOutQuad'); return false; }); }) } // visual_button_scroll_down(); function zs(id,id1){ $(".web-header .nav-li:first-child").eq(id).addClass("active").find("a").addClass("active"); $(".web-header .nav-li").eq(id).addClass("active").find("a").addClass("active"); $(".web-header .nav-li.active .nav-bot .li").eq(id1).addClass("active"); } // window.addEventListener('scroll', function(event) { // var depth, layer, layers, movement, topDistance, translate3d, _i, _len; // topDistance = this.pageYOffset; // layers = document.querySelectorAll("[data-type='parallax']"); // for (_i = 0, _len = layers.length; _i < _len; _i++) { // layer = layers[_i]; // depth = layer.getAttribute('data-depth'); // movement = -(topDistance * depth/5); // // translate3d = 'translate3d(0, ' + movement + 'px, 0)'; // translate3d = 'matrix(1, 0, 0, 1, 0 , ' + movement + ')'; // layer.style['-webkit-transform'] = translate3d; // layer.style['-moz-transform'] = translate3d; // layer .style['-ms-transform'] = translate3d; // layer.style['-o-transform'] = translate3d; // layer.style.transform = translate3d; // } // });