$(function(){ $('.js-m').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * 0.8) { _this.addClass('animate'); } }); $(window).scroll(function() { $('.js-m').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * 0.8) { _this.addClass('animate'); } }); }); $('.js-m2').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * 0.8) { _this.addClass('animate'); setTimeout(function(){ _this.addClass("animate-top800") },1000) } }); $(window).scroll(function() { $('.js-m2').each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * 0.8) { _this.addClass('animate'); setTimeout(function(){ _this.addClass("animate-top800") },1000) } }); }); if($(window).width()<768){ var igRul = $(".all-banner img").attr("src"); $(".all-banner").addClass("bac") $(".all-banner").css('background-image',"url("+igRul+")") console.log(4545) } });