-
-
Notifications
You must be signed in to change notification settings - Fork 676
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
13 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,7 +105,7 @@ Notes: | |
|
||
## 👩💻 Getting started - Script | ||
|
||
The latest, recommended version of LazyLoad is **12.0.2**. | ||
The latest, recommended version of LazyLoad is **12.0.3**. | ||
|
||
### To polyfill or not to polyfill IntersectionObserver? | ||
|
||
|
@@ -120,14 +120,14 @@ If you prefer to load a polyfill, the regular LazyLoad behaviour is granted. | |
The easiest way to use LazyLoad is to include the script from a CDN: | ||
|
||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/lazyload.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/lazyload.min.js"></script> | ||
``` | ||
|
||
Or, with the IntersectionObserver polyfill: | ||
|
||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/intersection-observer@0.5.1/intersection-observer.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/lazyload.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/intersection-observer@0.7.0/intersection-observer.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/lazyload.min.js"></script> | ||
``` | ||
|
||
Then, in your javascript code: | ||
|
@@ -162,8 +162,8 @@ Include RequireJS: | |
Then `require` the AMD version of LazyLoad, like this: | ||
|
||
```js | ||
var lazyLoadAmdUrl = "https://cdn.jsdelivr.net/npm/[email protected].2/dist/lazyload.amd.min.js"; | ||
var polyfillAmdUrl = "https://cdn.jsdelivr.net/npm/intersection-observer-amd@2.0.1/intersection-observer-amd.js"; | ||
var lazyLoadAmdUrl = "https://cdn.jsdelivr.net/npm/[email protected].3/dist/lazyload.amd.min.js"; | ||
var polyfillAmdUrl = "https://cdn.jsdelivr.net/npm/intersection-observer-amd@2.1.0/intersection-observer-amd.js"; | ||
|
||
/// Dynamically define the dependencies | ||
var dependencies = [ | ||
|
@@ -207,7 +207,7 @@ To do so, **you must define the options before including the script**. You can p | |
Then include the script. | ||
```html | ||
<script async src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/lazyload.min.js"></script> | ||
<script async src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/lazyload.min.js"></script> | ||
``` | ||
**Possibly place the script tag right before the closing `</body>` tag**. If you can't do that, LazyLoad could be executed before the browser has loaded all the DOM, and you'll need to call its `update()` method to make it check the DOM again. | ||
|
@@ -233,7 +233,7 @@ Same as above, but you must put the `addEventListener` code shown below before i | |
Then include the script. | ||
```html | ||
<script async src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/lazyload.min.js"></script> | ||
<script async src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/lazyload.min.js"></script> | ||
``` | ||
Now you'll be able to call its methods, like: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters