web-html5-scripts/cards/horizontal-cards-with-fade-animation/script.js
2020-01-20 21:00:54 +01:00

10 lines
230 B
JavaScript

$(window).scroll(function() {
$('.fadedfx').each(function(){
var imagePos = $(this).offset().top;
var topOfWindow = $(window).scrollTop();
if (imagePos < topOfWindow+500) {
$(this).addClass("fadeIn");
}
});
});