scrollReveal no longer automatically instantiates on the DOMContentLoaded
event. It now requires that you instantiate it manually.
<!-- Everything else… -->
<script src='{your_JavaScript_path}/scrollReveal.js'></script>
<script>
window.scrollReveal = new scrollReveal();
</script>
You can now pass your own starting defaults object to the scrollReveal constructor.
<script>
// The starting defaults.
var config = {
enter: 'bottom',
move: '0',
over: '0.66s',
delay: '0s',
easing: 'ease-in-out',
viewportFactor: 0.33,
reset: false,
init: true
};
window.scrollReveal = new scrollReveal( config );
</script>
Due to popular demand, the reset
keyword was added. Now, you can configure your animations to replay every time they enter the viewport:
example:
<script>
window.scrollReveal = new scrollReveal( {reset: true} );
</script>
See it in action: The demo page has been updated with the
reset: true
property.
Now you can replace the move
keyword with easing keywords to control the easing of your reveal animation.
example:
<div data-scrollReveal="after 0.33s, ease-out 24px"> Foo </div>