An open API service indexing awesome lists of open source software.

https://github.com/nechehin/lazyload

Javascript plugin for lazy load images with IntersectionObserver
https://github.com/nechehin/lazyload

image-loading images img intersectionobserver javascript javascript-plugin lazyload

Last synced: 6 days ago
JSON representation

Javascript plugin for lazy load images with IntersectionObserver

Awesome Lists containing this project

README

          

# lazyload
Javascript plugin for lazyload images and iframes. Fork of https://github.com/tuupola/jquery_lazyload , but with IntersectionObserver mode support
. Support src, srcset attributes for image and src for iframe. Use it as data-src, data-srcset.
## Install

### Load as script in your HTML
Copy source to yout public dir and connect script in HTML page. Example:

```html

$('.lazy').lazyload();

```
### As NPM module

```sh
npm i @nechehin/lazyload
```
use:

```javascript
import 'jquery';
import '@nechehin/lazyload';

jQuery(function() {
jQuery('.lazy').lazyload();
});
```

## How to use

```html

```

then in your code do:

```js
$(".lazy").lazyload();
```