|
2 | 2 |
|
3 | 3 | ## Version 15 |
4 | 4 |
|
| 5 | +#### 15.2.0 |
| 6 | + |
| 7 | +OPTIMIZE FOR SLOW CONNECTIONS WITH `cancel_on_exit` |
| 8 | + |
| 9 | +Want to optimize speed for users who scroll down fast on a slow connection? Just set `cancel_on_exit: true` and LazyLoad will cancel the download of images exiting the viewport while still loading, eventually restoring the original attributes. |
| 10 | + |
| 11 | +- Introduced the new `cancel_on_exit` option. |
| 12 | +- Introduced the `callback_cancel` option, just in case you want to perform any additional action whenever a download gets canceled by `cancel_on_exit`. |
| 13 | +- Created a new demo named `cancel_on_exit.html` so you can try the new `cancel_on_exit` option live. |
| 14 | +- Set `cancel_on_exit` to `true` in the following demos, so you can test how it behaves... |
| 15 | + - `image_ph_inline.html`, with an inline SVG placeholder |
| 16 | + - `image_ph_external.html`, with an external SVG placeholder |
| 17 | + - `delay_test.html`, in conjuction with the `delay_load` option |
| 18 | + - `fade_in.html`, with a beautiful fade-in effect. |
| 19 | + |
| 20 | +The `cancel_on_exit` option applies only to images so to the `img` (and `picture`) tags. It doesn't work for background images, `iframe`s nor `video`s. |
| 21 | + |
| 22 | +The `cancel_on_exit` option will probably default to `true` starting from the next major version, so give it a try! And please report your feedback in the comments of [#438](https://github.com/verlok/lazyload/issues/438). |
| 23 | + |
| 24 | +API |
| 25 | + |
| 26 | +- Added the `resetElementStatus()` method for when you need to tell LazyLoad to consider an image (or other DOM element) again. This is particularly useful if you change the `data-src` attribute after the previous `data-src` was loaded). See the [API section](README.md#-api) in the README file for more information. |
| 27 | + |
| 28 | +FIX |
| 29 | + |
| 30 | +- The `callback_exit` callback was called several times (for every images out of the viewport) at instance creation or upon `update()` calls. Now the callback is properly called only when any element exits the viewport. |
| 31 | + |
| 32 | +INTERNALS |
| 33 | + |
| 34 | +- Improved script performance by reducing the number of event listeners used for loading elements. |
| 35 | +- Changed the values that the (internally used) `data-ll-status` attribute can take. Removed the status `"observed"` (it was useless) and introduced status `"delayed"`. |
| 36 | + |
5 | 37 | #### 15.1.1 |
6 | 38 |
|
7 | 39 | Fixed a bug when loading lazy background images on HiDPI screens, `data-bg-hidpi` was mandatory, not it fallbacks to `data-bg`. #430 |
|
0 commit comments