Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs: fix PR issues in docs
  • Loading branch information
igorkamyshev committed Jul 24, 2020
1 parent 6558293 commit 8a6be62
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -204,13 +204,13 @@ observer.triggerLoad(coolImage);

### Large image improvment

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

```html
<img class="lozad" data-placeholder="red" data-src="image.png" />
<img class="lozad" data-placeholder-background="red" data-src="image.png" />
```

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

## Example with picture tag

Expand Down
2 changes: 1 addition & 1 deletion demo/index.html
Expand Up @@ -58,7 +58,7 @@ <h1><a href="https://github.com/ApoorvSaxena/lozad.js"><strong>Lozad.js</strong>
<h1>Lozad.js - Performant Lazy Loading Library</h1>
</article>
<article class="thumb">
<img class="lozad" data-placeholder="#583624" data-src="images/thumbs/01.jpg" data-index="1" />
<img class="lozad" data-placeholder-background="#583624" data-src="images/thumbs/01.jpg" data-index="1" />
<noscript><img src="images/thumbs/01.jpg" data-index="1" /></noscript>
<h2>Image 1</h2>
</article>
Expand Down
4 changes: 2 additions & 2 deletions dist/lozad.es.js
Expand Up @@ -84,8 +84,8 @@ function markAsLoaded(element) {
}

function preLoad(element) {
if (element.getAttribute('data-placeholder')) {
element.style.background = element.getAttribute('data-placeholder');
if (element.getAttribute('data-placeholder-background')) {
element.style.background = element.getAttribute('data-placeholder-background');
}
}

Expand Down
4 changes: 2 additions & 2 deletions dist/lozad.js
Expand Up @@ -90,8 +90,8 @@
}

function preLoad(element) {
if (element.getAttribute('data-placeholder')) {
element.style.background = element.getAttribute('data-placeholder');
if (element.getAttribute('data-placeholder-background')) {
element.style.background = element.getAttribute('data-placeholder-background');
}
}

Expand Down
2 changes: 1 addition & 1 deletion dist/lozad.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/lozad.js
Expand Up @@ -79,8 +79,8 @@ function markAsLoaded(element) {
}

function preLoad(element) {
if (element.getAttribute('data-placeholder')) {
element.style.background = element.getAttribute('data-placeholder')
if (element.getAttribute('data-placeholder-background')) {
element.style.background = element.getAttribute('data-placeholder-background')
}
}

Expand Down

0 comments on commit 8a6be62

Please sign in to comment.