Skip to content

Commit 8a6be62

Browse files
committed
docs: fix PR issues in docs
1 parent 6558293 commit 8a6be62

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,13 @@ observer.triggerLoad(coolImage);
204204

205205
### Large image improvment
206206

207-
Sometimes image loading takes a long time. For this case, you can add a placeholder color:
207+
Sometimes image loading takes a long time. For this case, you can add a placeholder background:
208208

209209
```html
210-
<img class="lozad" data-placeholder="red" data-src="image.png" />
210+
<img class="lozad" data-placeholder-background="red" data-src="image.png" />
211211
```
212212

213-
Lozad set the background of `img` element and users will see the fallback.
213+
Lozad sets a placeholder background color of img element and users will see the fallback till the image loads.
214214

215215
## Example with picture tag
216216

Diff for: demo/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h1><a href="https://github.com/ApoorvSaxena/lozad.js"><strong>Lozad.js</strong>
5858
<h1>Lozad.js - Performant Lazy Loading Library</h1>
5959
</article>
6060
<article class="thumb">
61-
<img class="lozad" data-placeholder="#583624" data-src="images/thumbs/01.jpg" data-index="1" />
61+
<img class="lozad" data-placeholder-background="#583624" data-src="images/thumbs/01.jpg" data-index="1" />
6262
<noscript><img src="images/thumbs/01.jpg" data-index="1" /></noscript>
6363
<h2>Image 1</h2>
6464
</article>

Diff for: dist/lozad.es.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ function markAsLoaded(element) {
8484
}
8585

8686
function preLoad(element) {
87-
if (element.getAttribute('data-placeholder')) {
88-
element.style.background = element.getAttribute('data-placeholder');
87+
if (element.getAttribute('data-placeholder-background')) {
88+
element.style.background = element.getAttribute('data-placeholder-background');
8989
}
9090
}
9191

Diff for: dist/lozad.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@
9090
}
9191

9292
function preLoad(element) {
93-
if (element.getAttribute('data-placeholder')) {
94-
element.style.background = element.getAttribute('data-placeholder');
93+
if (element.getAttribute('data-placeholder-background')) {
94+
element.style.background = element.getAttribute('data-placeholder-background');
9595
}
9696
}
9797

Diff for: dist/lozad.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/lozad.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ function markAsLoaded(element) {
7979
}
8080

8181
function preLoad(element) {
82-
if (element.getAttribute('data-placeholder')) {
83-
element.style.background = element.getAttribute('data-placeholder')
82+
if (element.getAttribute('data-placeholder-background')) {
83+
element.style.background = element.getAttribute('data-placeholder-background')
8484
}
8585
}
8686

0 commit comments

Comments
 (0)