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; // } // });