Skip to content

Commit 088826f

Browse files
committed
Merge branch 'hotfix/17.8.3'
2 parents 966071e + aa9f7f9 commit 088826f

File tree

6 files changed

+30
-43
lines changed

6 files changed

+30
-43
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.8.3
6+
7+
- Fixed `callback_error` in background images demos, like suggested in #573. Thanks to @Soul244.
8+
59
#### 17.8.2
610

711
- Fixed a bug which occurred if the network connection went off and on again after a LazyLoad instance was destroyed

README.md

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

176176
## 👩‍💻 Getting started - Script
177177

178-
The latest, recommended version of LazyLoad is **17.8.2**.
178+
The latest, recommended version of LazyLoad is **17.8.3**.
179179

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

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

186186
```html
187-
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/lazyload.min.js"></script>
187+
<script src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/lazyload.min.js"></script>
188188
```
189189

190190
Then, in your javascript code:
@@ -225,7 +225,7 @@ Then include the script.
225225
```html
226226
<script
227227
async
228-
src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/lazyload.min.js"
228+
src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/lazyload.min.js"
229229
></script>
230230
```
231231

@@ -259,7 +259,7 @@ Then include the script.
259259
```html
260260
<script
261261
async
262-
src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/lazyload.min.js"
262+
src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/lazyload.min.js"
263263
></script>
264264
```
265265

demos/background_images.html

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
<html>
33
<head lang="en">
44
<meta charset="UTF-8" />
5-
<title>
6-
Background images - Lazyload demos
7-
</title>
5+
<title>Background images - Lazyload demos</title>
86
<meta name="viewport" content="width=device-width, initial-scale=1" />
97
<style>
108
ul,
@@ -42,11 +40,7 @@ <h1>Background images demo</h1>
4240
></a>
4341
</li>
4442
<li>
45-
<a
46-
class="lazy"
47-
href="#"
48-
data-bg="https://via.placeholder.com/220x280?text=Img+02"
49-
></a>
43+
<a class="lazy" href="#" data-bg="https://via.placeholder.com/220x280?text=Img+02"></a>
5044
</li>
5145
<li>
5246
<a
@@ -57,11 +51,7 @@ <h1>Background images demo</h1>
5751
></a>
5852
</li>
5953
<li>
60-
<a
61-
class="lazy"
62-
href="#"
63-
data-bg="https://via.placeholder.com/220x280?text=Img+04"
64-
></a>
54+
<a class="lazy" href="#" data-bg="https://via.placeholder.com/220x280?text=Img+04"></a>
6555
</li>
6656
<li>
6757
<a
@@ -72,11 +62,7 @@ <h1>Background images demo</h1>
7262
></a>
7363
</li>
7464
<li>
75-
<a
76-
class="lazy"
77-
href="#"
78-
data-bg="https://via.placeholder.com/220x280?text=Img+06"
79-
></a>
65+
<a class="lazy" href="#" data-bg="https://via.placeholder.com/220x280?text=Img+06"></a>
8066
</li>
8167
<li>
8268
<a
@@ -347,11 +333,7 @@ <h1>Background images demo</h1>
347333
<script src="../dist/lazyload.min.js"></script>
348334
<script>
349335
function logElementEvent(eventName, element) {
350-
console.log(
351-
Date.now(),
352-
eventName,
353-
element.getAttribute("data-bg88da112-bg-hidpi=bg")
354-
);
336+
console.log(Date.now(), eventName, element.getAttribute("data-bg88da112-bg-hidpi=bg"));
355337
}
356338

357339
var callback_enter = function (element) {
@@ -368,8 +350,8 @@ <h1>Background images demo</h1>
368350
};
369351
var callback_error = function (element) {
370352
logElementEvent("💀 ERROR", element);
371-
element.src =
372-
"https://via.placeholder.com/220x280/?text=Error+Placeholder";
353+
element.style.backgroundImage =
354+
"url('https://via.placeholder.com/440x560/?text=Error+Placeholder')";
373355
};
374356
var callback_finish = function () {
375357
logElementEvent("✔️ FINISHED", document.documentElement);

demos/background_images_image-set.html

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ <h1>Background images with <q>image-set</q> demo</h1>
5252
href="#"
5353
style="
5454
background-image: -webkit-image-set(
55-
url('https://via.placeholder.com/220x280?text=Img+02+Left') 1x,
56-
url('https://via.placeholder.com/440x560?text=Img+02+Left') 2x
57-
), -webkit-image-set(
55+
url('https://via.placeholder.com/220x280?text=Img+02+Left') 1x,
56+
url('https://via.placeholder.com/440x560?text=Img+02+Left') 2x
57+
), -webkit-image-set(
5858
url('https://via.placeholder.com/220x280?text=Img+02+Right') 1x,
5959
url('https://via.placeholder.com/440x560?text=Img+02+Right') 2x
6060
);
6161
background-image: image-set(
62-
url('https://via.placeholder.com/220x280?text=Img+02+Left') 1x,
63-
url('https://via.placeholder.com/440x560?text=Img+02+Left') 2x
64-
),
65-
image-set(
66-
url('https://via.placeholder.com/220x280?text=Img+02+Right') 1x,
67-
url('https://via.placeholder.com/440x560?text=Img+02+Right') 2x
68-
);
62+
url('https://via.placeholder.com/220x280?text=Img+02+Left') 1x,
63+
url('https://via.placeholder.com/440x560?text=Img+02+Left') 2x
64+
),
65+
image-set(
66+
url('https://via.placeholder.com/220x280?text=Img+02+Right') 1x,
67+
url('https://via.placeholder.com/440x560?text=Img+02+Right') 2x
68+
);
6969
"
7070
></a>
7171
</li>
@@ -353,7 +353,8 @@ <h1>Background images with <q>image-set</q> demo</h1>
353353
};
354354
var callback_error = function (element) {
355355
logElementEvent("💀 ERROR", element);
356-
element.src = "https://via.placeholder.com/220x280/?text=Error+Placeholder";
356+
element.style.backgroundImage =
357+
"url('https://via.placeholder.com/440x560/?text=Error+Placeholder')";
357358
};
358359
var callback_finish = function () {
359360
logElementEvent("✔️ FINISHED", document.documentElement);

demos/background_images_multi.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ <h1>Multiple background images demo</h1>
392392
};
393393
var callback_error = function (element) {
394394
logElementEvent("💀 ERROR", element);
395-
element.src =
396-
"https://via.placeholder.com/440x560/?text=Error+Placeholder";
395+
element.style.backgroundImage =
396+
"url('https://via.placeholder.com/440x560/?text=Error+Placeholder')";
397397
};
398398
var callback_finish = function () {
399399
logElementEvent("✔️ FINISHED", document.documentElement);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vanilla-lazyload",
3-
"version": "17.8.2",
3+
"version": "17.8.3",
44
"description": "LazyLoad is a lightweight (2.4 kB) and flexible script that speeds up your web application by deferring the loading of your below-the-fold images, videos and iframes to when they will enter the viewport. It's written in plain \"vanilla\" JavaScript, it leverages the IntersectionObserver API, it supports responsive images, it optimizes your website for slower connections, and can enable native lazy loading.",
55
"main": "dist/lazyload.min.js",
66
"module": "dist/lazyload.esm.js",

0 commit comments

Comments
 (0)