js html animation
function ik_enableScrollAnimations(t) {
t = t || window, $(t).on("scroll", $(function() {
$(".animate").each(function() {
if ($(this).data("scrollAnimation") !== !1) {
var e = $(this).closest(".container").parent();
e.length || (e = $(this).parent());
var n = $(t).height(),
i = $(t).scrollTop(),
r = 0;
e.data("animate-offset") && (r = e.data("animate-offset"));
var o = e.offset().top;
"string" == typeof t && (o += i), i + n >= o + r && $(this).addClass("in")
}
})
}, 0)), $(window).load(function() {
$(t).trigger("scroll")
})
}
Written by Igor Krasilnikov
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Js
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#