Skip to content

Commit 8e9e5d0

Browse files
committed
Merge branch 'release/17.7.0'
2 parents bdf56c2 + 551125a commit 8e9e5d0

16 files changed

+1074
-25
lines changed

CHANGELOG.md

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

33
## Version 17
44

5+
#### 17.7.0
6+
7+
- Added the new option `restore_on_error` to restore original attributes on error.
8+
59
#### 17.6.1
610

711
- Removed nasty "debugger" from code (sorry about that rookie mistake!)

README.md

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

160160
## 👩‍💻 Getting started - Script
161161

162-
The latest, recommended version of LazyLoad is **17.6.1**.
162+
The latest, recommended version of LazyLoad is **17.7.0**.
163163

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

@@ -168,7 +168,7 @@ Quickly understand how to upgrade from a previous version reading the [practical
168168
The easiest way to use LazyLoad is to include the script from a CDN:
169169

170170
```html
171-
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.6.1/dist/lazyload.min.js"></script>
171+
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.7.0/dist/lazyload.min.js"></script>
172172
```
173173

174174
Then, in your javascript code:
@@ -209,7 +209,7 @@ Then include the script.
209209
```html
210210
<script
211211
async
212-
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.6.1/dist/lazyload.min.js"
212+
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.7.0/dist/lazyload.min.js"
213213
></script>
214214
```
215215

@@ -243,7 +243,7 @@ Then include the script.
243243
```html
244244
<script
245245
async
246-
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.6.1/dist/lazyload.min.js"
246+
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.7.0/dist/lazyload.min.js"
247247
></script>
248248
```
249249

@@ -600,6 +600,8 @@ The [demos](https://github.com/verlok/vanilla-lazyload/tree/master/demos) folder
600600
| Loading | Asynchronous loading LazyLoad + InterserctionObserver with requireJS | [Code](demos/amd_polyfill.html) | [Live](https://www.andreaverlicchi.eu/vanilla-lazyload/demos/amd_polyfill.html) |
601601
| Loading | Asynchronous loading LazyLoad with `<script async>` | [Code](demos/async.html) | [Live](https://www.andreaverlicchi.eu/vanilla-lazyload/demos/async.html) |
602602
| Loading | Asynchronous loading multiple LazyLoad instances with `<script async>` | [Code](demos/async_multiple.html) | [Live](https://www.andreaverlicchi.eu/vanilla-lazyload/demos/async_multiple.html) |
603+
| Error | Test error loading behaviour when `restore_on_error` is `false` | [Code](demos/error_no_restore.html) | [Live](https://www.andreaverlicchi.eu/vanilla-lazyload/demos/error_no_restore.html) |
604+
| Error | Test error loading behaviour when `restore_on_error` is `true` | [Code](demos/error_restore.html) | [Live](https://www.andreaverlicchi.eu/vanilla-lazyload/demos/error_restore.html) |
603605
| Technique | Fade in images as they load | [Code](demos/fade_in.html) | [Live](https://www.andreaverlicchi.eu/vanilla-lazyload/demos/fade_in.html) |
604606
| Technique | Lazy load images in CSS-only horizontal sliders (Netflix style) | [Code](demos/sliders_css_only.html) | [Live](https://www.andreaverlicchi.eu/vanilla-lazyload/demos/sliders_css_only.html) |
605607
| Technique | Lazily create Swiper instances and lazily load Swiper images | [Code](demos/swiper.html) | [Live](https://www.andreaverlicchi.eu/vanilla-lazyload/demos/swiper.html) |
@@ -709,6 +711,7 @@ Here's the list of the options.
709711
| `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)}` |
710712
| `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")}` |
711713
| `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` |
714+
| `restore_on_error` | Tells LazyLoad if to restore the original values of `src`, `srcset` and `sizes` when a loading error occurs. | `false` | `true` |
712715

713716
### Methods
714717

0 commit comments

Comments
 (0)