vanilla-lazyload
Advanced tools
Comparing version 12.0.0 to 12.0.1
@@ -5,4 +5,14 @@ # CHANGELOG | ||
### 12.0.0 | ||
#### 12.0.1 | ||
- Updated CHANGELOG.md and README.md to mention the change of the option name `callback_load` which is called `callback_loaded` in versions 11.0.0 and above. | ||
#### 12.0.0 | ||
- Reorganized code | ||
- Improved native lazy loading demos | ||
- Aligned console messages throughout all demos. | ||
#### 12.0.0-beta.0 | ||
- Added the `use_native` option which enables *native lazy loading* (where supported) with the `loading="lazy"` attribute. See #331 | ||
@@ -56,2 +66,3 @@ - Added two demos: | ||
- **Changed** `callback_enter`. This callback is now called whenever an element enters the viewport, even when `load_delay` is set. In previous versions, this callback was delayed until an element started loading if a `load_delay` was set. Note that this is a **possible breaking change**, which you can fix using `callback_reveal` instead. | ||
- **Renamed** `callback_loaded` is the new name of `callback_load`. | ||
- **Added** `callback_exit`. This callback is called whenever an element exits the viewport, even if a `load_delay` is set. | ||
@@ -58,0 +69,0 @@ - **Added** `callback_reveal`. This callback is called just after an element starts loading. |
{ | ||
"name": "vanilla-lazyload", | ||
"version": "12.0.0", | ||
"version": "12.0.1", | ||
"description": "A fast, lightweight script to load images as they enter the viewport. SEO friendly, it supports responsive images (both srcset + sizes and picture) and progressive JPEG", | ||
@@ -8,2 +8,3 @@ "main": "dist/lazyload.min.js", | ||
"browser": "dist/lazyload.min.js", | ||
"typings": "typings/lazyload.d.ts", | ||
"dependencies": {}, | ||
@@ -31,3 +32,4 @@ "devDependencies": { | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"typings" | ||
], | ||
@@ -34,0 +36,0 @@ "repository": { |
@@ -648,3 +648,3 @@ LazyLoad is a fast, lightweight and flexible script that **speeds up your web application** by loading your content images, videos and iframes only **as they enter the viewport**. It's written in plain "vanilla" JavaScript, it leverages the [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) API, it works with [responsive images](https://alistapart.com/article/responsive-images-in-practice) and it supports native lazy loading. See [notable features](#-notable-features) for more. | ||
| `callback_set` | **Deprecated from version 11** → It still works, but please update your code to use `callback_reveal` instead. | `null` | `(el)=>{console.log("Loading", el)}` | | ||
| `callback_loaded` | A callback function which is called whenever an element finishes loading. | `null` | `(el)=>{console.log("Loaded", el)}` | | ||
| `callback_loaded` | A callback function which is called whenever an element finishes loading. Note that, in version older than 11.0.0, this option went under the name `callback_load`. | `null` | `(el)=>{console.log("Loaded", el)}` | | ||
| `callback_error` | A callback function which is called whenever an element triggers an error. | `null` | `(el)=>{console.log("Error", el)}` | | ||
@@ -651,0 +651,0 @@ | `callback_finish` | A callback function which is called when there are no more elements to load _and_ all elements have been downloaded. | `null` | `()=>{console.log("Finish")}` | |
209164
16
1653