lazy-embeds

1.0.1 • Public • Published

SYNOPSIS

Load embeds/iframes lazily, only when they're in viewport.

Build Status

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    14
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    14
  • 1.0.0
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i lazy-embeds

Weekly Downloads

14

Version

1.0.1

License

MIT

Last publish

Collaborators

  • iefserge