https://github.com/anthinkingcoder/lazyload
https://github.com/anthinkingcoder/lazyload
a
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/anthinkingcoder/lazyload
- Owner: anthinkingcoder
- Created: 2018-03-06T06:10:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-08T06:52:09.000Z (about 7 years ago)
- Last Synced: 2025-06-04T09:32:00.330Z (6 months ago)
- Topics: a
- Language: JavaScript
- Size: 93.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lazyload
use IntersectionObserver Api to implement lazyload, IntersectionObserver only support chrome,
if not support intersectionObserver,please use [IntersectionObserver polyfill](https://github.com/w3c/IntersectionObserver/tree/master/polyfill)
## option
```js
let options = {
root: null,
rootMargin: '0% 0%',
threshold: 0,
selector: '[data-src]'
}
```
## Usage
```js
import Lazyload from 'lazyload'
Lazyload({
selector: '[data-src]'
})
```
## example
please see /demo/lazyloadDemo.html