You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 23, 2019. It is now read-only.
The easiest way to do this without being too hacky would be to set an extra class on an animated element. You'll need to change the checkInViewport-function to:
function checkInViewport(scrollBottom, domElement){
var elementPos = $(domElement).offset().top;
if((parseInt(scrollBottom)+parseInt(pixelOffset)) > elementPos){
$(domElement).addClass(inClassName).removeClass(outClassName).addClass('hasAnimated');
} else {
if(!$(domElement).hasClass('hasAnimated')){
$(domElement).removeClass(inClassName).addClass(outClassName);
}
}
}
What you essentially do is add the hasAnimated-class to any of the tracked elements that have animated. If an element has this class, it will not return to default after the element is scrolled out of the viewport. This is a pretty easy fix and doen'st require much reworking of the script, enjoy!
Is there an easy way to implement functionality so that the elements stay visible once animated? Thanks!
The text was updated successfully, but these errors were encountered: