Emergence.js is a cross-platform, high-performance viewport checker library which detects if HTML components are within the viewport, and performs customized actions when the weather are seen and/or hidden.
# NPM $ npm set up emergence.js --save # Bower $ bower set up emergence.js --save
Insert the minified model of the emergence.js into the net web page.
Initialize the emergence.js and also you’re able to go.
data-emergence="hidden" attribute to any factor you wish to look ahead to the scroll place.
<div class="myElement" data-emergence="hidden"></div>
Apply customized CSS types (e.g. CSS3 based mostly animations) to the factor when it turns into seen or invisible as you scroll the net web page.
Or carry out customized actions when the factor turns into seen or invisible as you scroll the net web page.
Attainable choices to customise the emergence.js library.
// Refire visibility checks exterior of the load, scroll and resize occasions already baked into the plugin emergence.interact(); // Disable Emergence emergence.disengage();