Skip to content

Commit

Permalink
Merge branch 'release/12.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
verlok committed Oct 1, 2019
2 parents 4f26915 + 22f6ad2 commit 74def55
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Version 12

#### 12.0.3

Updated the IntersectionObserver polyfill to version 0.7.0.

#### 12.0.2

Improved detection of browser support of IntersectionObserver, as suggested in #362. Thanks to @kaldonir
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand All @@ -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:
Expand Down Expand Up @@ -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 = [
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vanilla-lazyload",
"version": "12.0.2",
"version": "12.0.3",
"description": "A fast, lightweight script to load images as they enter the viewport. SEO friendly, it supports responsive images (both srcset + sizes and picture) and progressive JPEG",
"main": "dist/lazyload.min.js",
"module": "dist/lazyload.esm.js",
Expand Down

0 comments on commit 74def55

Please sign in to comment.