function revealOnScroll() {
var scrolled = $window.scrollTop();
$(".revealOnScroll:not(.animated)").each(function () {
var $this = $(this),
offsetTop = $this.offset().top;
if (scrolled + win_height_padded > offsetTop) {
if ($this.data('timeout')) {
window.setTimeout(function(){
$this.addClass('animated ' + $this.data('animation'));
}, parseInt($this.data('timeout'),1));
} else {
$this.addClass('animated ' + $this.data('animation'));
}
}
});
No comments:
Post a Comment