Get started with lethargy CDN

MIT licensed

Lethargy: Lightweight, lazy-loads JS till viewport.

Tags:
  • scroll
  • wheel
  • mousewheel
  • scrolljacking
  • inertial
  • trackpad
  • magic
  • mouse

Stable version

Copied!

How to start using lethargy CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with lethargy CDN - cdnhub.io</title>
  <link rel="stylesheet" href="styles.css">
  <script src="https://cdn.cdnhub.io/lethargy/1.0.9/lethargy.min.js"></script>
</head>
<body>
  <img data-src="image1.jpg" class="lazyload" alt="Image 1">
  <img data-src="image2.jpg" class="lazyload" alt="Image 2">
  <img data-src="image3.jpg" class="lazyload" alt="Image 3">
  <script>
    import LazyLoad from 'lethargy';

    const lazyLoad = new LazyLoad({
      elements_selector: '.lazyload'
    });

    lazyLoad.update();
  </script>
</body>
</html>
Copied!
Copied!

All versions