Skip to content

Commit e5ce802

Browse files
committed
Merge branch 'release/17.4.0'
2 parents 1425819 + 2c75d04 commit e5ce802

14 files changed

+130
-381
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Version 17
44

5+
#### 17.4.0
6+
7+
- Adding native lazy loading for videos, as discussed in #527. Thanks to @saschaeggi.
8+
- Updated the `native_lazyload_conditional.html` demo with the new best practice for cross browser native lazy loading.
9+
510
#### 17.3.2
611

712
- Fixes double trigger of `callback_load` after a watched image was loaded using the static `load()` method (#526). Thanks to @nick-vincent.

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Please note that the video poster can be lazily loaded too.
153153

154154
## 👩‍💻 Getting started - Script
155155

156-
The latest, recommended version of LazyLoad is **17.3.2**.
156+
The latest, recommended version of LazyLoad is **17.4.0**.
157157

158158
Quickly understand how to upgrade from a previous version reading the [practical upgrade guide](UPGRADE.md).
159159

@@ -170,14 +170,14 @@ If you prefer to load a polyfill, the regular LazyLoad behaviour is granted.
170170
The easiest way to use LazyLoad is to include the script from a CDN:
171171

172172
```html
173-
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.3.2/dist/lazyload.min.js"></script>
173+
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.4.0/dist/lazyload.min.js"></script>
174174
```
175175

176176
Or, with the IntersectionObserver polyfill:
177177

178178
```html
179179
<script src="https://cdn.jsdelivr.net/npm/[email protected]/intersection-observer.js"></script>
180-
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.3.2/dist/lazyload.min.js"></script>
180+
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.4.0/dist/lazyload.min.js"></script>
181181
```
182182

183183
Then, in your javascript code:
@@ -209,7 +209,7 @@ Include RequireJS:
209209
Then `require` the AMD version of LazyLoad, like this:
210210

211211
```js
212-
var lazyLoadAmdUrl = "https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.3.2/dist/lazyload.amd.min.js";
212+
var lazyLoadAmdUrl = "https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.4.0/dist/lazyload.amd.min.js";
213213
var polyfillAmdUrl = "https://cdn.jsdelivr.net/npm/[email protected]/intersection-observer-amd.js";
214214

215215
/// Dynamically define the dependencies
@@ -254,7 +254,7 @@ Then include the script.
254254
```html
255255
<script
256256
async
257-
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.3.2/dist/lazyload.min.js"
257+
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.4.0/dist/lazyload.min.js"
258258
></script>
259259
```
260260
@@ -288,7 +288,7 @@ Then include the script.
288288
```html
289289
<script
290290
async
291-
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.3.2/dist/lazyload.min.js"
291+
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.4.0/dist/lazyload.min.js"
292292
></script>
293293
```
294294
@@ -397,7 +397,7 @@ myLazyLoad.update();
397397
398398
### Mixed native and JS-based lazy loading
399399
400-
> 💡 **Use case**: you want to use the `use_native` option to delegate the loading of images to the browsers engine where supported, but you also want to lazily load backgroud images or videos.
400+
> 💡 **Use case**: you want to use the `use_native` option to delegate the loading of images, iframes and videos to the browsers engine where supported, but you also want to lazily load backgroud images.
401401
402402
HTML
403403
@@ -422,6 +422,8 @@ const lazyBackground = new LazyLoad({
422422
});
423423
```
424424
425+
[DEMO](https://www.andreaverlicchi.eu/vanilla-lazyload/demos/native_lazyload_conditional.html) - [SOURCE](https://github.com/verlok/vanilla-lazyload/blob/master/demos/native_lazyload_conditional.html) - [API](#-api)
426+
425427
### Scrolling panel(s)
426428
427429
> 💡 **Use case**: when your scrolling container is not the main browser window, but a scrolling container.
@@ -730,7 +732,7 @@ Here's the list of the options.
730732
| `callback_error` | A callback function which is called whenever an element triggers an error. Arguments: DOM element, lazyload instance. | `null` | `(el)=>{console.log("Error", el)}` |
731733
| `callback_applied` | A callback function which is called whenever a multiple background element starts loading. Arguments: DOM element, lazyload instance. | `null` | `(el)=>{console.log("Applied", el)}` |
732734
| `callback_finish` | A callback function which is called when there are no more elements to load _and_ all elements have been downloaded. Arguments: lazyload instance. | `null` | `()=>{console.log("Finish")}` |
733-
| `use_native` | This boolean sets whether or not to use [native lazy loading](https://addyosmani.com/blog/lazy-loading/) to do [hybrid lazy loading](https://www.smashingmagazine.com/2019/05/hybrid-lazy-loading-progressive-migration-native/). On browsers that support it, LazyLoad will set the `loading="lazy"` attribute on images and iframes, and delegate their loading to the browser. | `false` | `true` |
735+
| `use_native` | This boolean sets whether or not to use [native lazy loading](https://addyosmani.com/blog/lazy-loading/) to do [hybrid lazy loading](https://www.smashingmagazine.com/2019/05/hybrid-lazy-loading-progressive-migration-native/). On browsers that support it, LazyLoad will set the `loading="lazy"` attribute on images, iframes and videos, and delegate their loading to the browser. | `false` | `true` |
734736
735737
### Methods
736738

0 commit comments

Comments
 (0)