Created
January 29, 2019 11:57
-
-
Save mikhy888/a7129688f874c22e3aab90fb32c4e958 to your computer and use it in GitHub Desktop.
Single side scroll reveal animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//scroll direction and anim | |
var scrollDirection = function (elem) { | |
$(window).on('DOMMouseScroll mousewheel', function (event) { | |
if (event.originalEvent.detail > 0 || event.originalEvent.wheelDelta < 0) { | |
if (elem.parent().isOnScreen()) { | |
console.log("malar"); | |
elem.each(function () { | |
var $this = $(this); | |
var delay = $this.attr("data-delay"); | |
setTimeout(function () { | |
$this.addClass("show"); | |
}, delay); | |
}); | |
} | |
} else { | |
if (elem.isOnScreen() == false) { | |
elem.removeClass("show"); | |
} | |
} | |
}); | |
}($('.single-anim-inner')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment