A Simple, Lightweight Image Lazy Loader In Pure JavaScript | Simply Lazy

Simply Lazy is a simple and lightweight (0.6 KB) lazy uploader for pure JavaScript that works even in IE * and uses the Intersection Observer API to load lazy images.

lazy loading javascript on scroll example, lazy load pure javascript, lazy load images example, lazy loading javascript example, lazy load content on scroll

How to make use of it:

1. Load the simplyLazy.min.js JavaScript library within the HTML doc.

<script src="./dist/simplyLazy.min.js"></script>

2. Load the polyfill for Internet Explorer users. OPTIONAL.

<script src="https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver"></script>

3. Embed pictures into your doc utilizing the data-src attribute:

<img data-src="1.jpg" alt="Image 1" />
<img data-src="2.jpg" alt="Image 2" />
...

4. Enable the lazy loader on these pictures.

SimplyLazy({
  // options here
}).lazy('img');

5. Set the fallback picture if the unique picture fails to load.

SimplyLazy({
  defaultImage: 'data:image/gif;base64
}).lazy('img');

6. Available callback features.

SimplyLazy({
  onImageLoad: (imgEl) => {
    // do something
  },
  onImageError: (imgEl) => {
    // do something
  },
  allImagesFinished: () => {
    // do something
  },
}).lazy('img');

Tiny Image Lazy Loader With Intersection Observer, Simply Lazy Plugin/Github, lazy loading with blurred image effect, lazyload example, lazy loading intersection observer

Simply-Lazy-Demo


See Demo And Download

Official Website(maxshuty): Click Here

This superior jQuery/javascript plugin is developed by maxshuty. For extra advanced usage, please go to the official website.

Related Posts

Input-Values-Using-Mouse-Drag

Create Side Sliders Input Values Using Mouse Drag | Pointer Lock

HTML Range Slider is a lightweight library to create side sliders to adjust values easily and precisely by making use of the Pointer Lock API. Side Slider…

simple-parallax-scrolling-js

Smooth and Lightweight Parallax Scroll Library in Pure Javascript

Lightweight and seamless parallax scrolling library implemented in pure javascript using hardware acceleration for additional performance. Main Features Extremely lightweight with no dependencies A few kilobytes of pure…

Convert-Form-Data-to-JSON

How to Convert Form Data to JSON with HTML Forms | FormsJS

FormsJS is a simple-to-use JavaScript library that covers type subject values to JSON in real time. The items containing the data category will be analyzed automatically. It…

editable-html-table-using-javascript

A Small jQuery Extension to Convert An Editable HTML Table

Editable Table is a small jQuery extension to convert an editable HTML table for fast data entry and validation. A small jQuery extension to convert a static…

jquery.youtube-background

Simple jQuery Plugin for Embedding YouTube Videos As Cover Background

jquery.youtube-background is a jQuery plugin built to facilitate YouTube embeds as cover wallpaper using the YouTube Embed API. There is another jQuery Youtube Video Background plugin that…

Data-Table-Generator-Tabulator

Interactive Data Table Generator with JS/jQuery and JSON | Tabulator

Tabulator allows you to create interactive tables in seconds from any HTML Table, JavaScript array, AJAX data source, or JSON format data. Just include the library in your…