lazy-embeds
v1.0.1
Published
Load embeds/iframes lazily, only when they're in viewport
Downloads
22
Readme
SYNOPSIS
Load embeds/iframes lazily, only when they're in viewport.
USAGE
Setup:
<div class="container">
<iframe class="lazy-embed" data-src="http://iframe.url"></iframe>
</div>
var lazyEmbeds = require('lazy-embeds');
var container = document.querySelector('.container');
lazyEmbeds.addContainer(container);
window.addEventListener('scroll', _.debounce(lazyEmbeds.test, 50));
##LICENSE
MIT