Skip to content

Commit

Permalink
Added 1 row in comparison vs lazySizes
Browse files Browse the repository at this point in the history
  • Loading branch information
verlok committed Apr 17, 2024
1 parent 2004763 commit 8687059
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ OR, if you prefer to import it as an ES module:

```html
<script type="module">
import LazyLoad from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm'
import LazyLoad from "https://cdn.jsdelivr.net/npm/[email protected]/+esm";
</script>
```

Expand All @@ -205,7 +205,7 @@ var lazyLoadInstance = new LazyLoad({
});
```

To be sure that DOM for your lazy content is ready when you instantiate LazyLoad, **place the script tag right before the closing `</body>` tag**.
To be sure that DOM for your lazy content is ready when you instantiate LazyLoad, **place the script tag right before the closing `</body>` tag**.

If more DOM arrives later, e.g. via an AJAX call, you'll need to call `lazyLoadInstance.update();` to make LazyLoad check the DOM again.

Expand Down Expand Up @@ -605,8 +605,8 @@ Didn't find the [recipe](#-recipes) that exactly matches your case? We have demo

The [demos](https://github.com/verlok/vanilla-lazyload/tree/master/demos) folder contains 30+ use cases of vanilla-lazyload. You might find there what you're looking for.

| Type | Title | Code | Demo |
| --------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Type | Title | Code | Demo |
| --------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Content | Simple lazy loaded images, not using any placeholder | [Code](demos/image_basic.html) | [Live](https://verlok.github.io/vanilla-lazyload/demos/image_basic.html) |
| Content | Lazy images that use an inline SVG as a placeholder | [Code](demos/image_ph_inline.html) | [Live](https://verlok.github.io/vanilla-lazyload/demos/image_ph_inline.html) |
| Content | Lazy images that use an external SVG file as a placeholder | [Code](demos/image_ph_external.html) | [Live](https://verlok.github.io/vanilla-lazyload/demos/image_ph_external.html) |
Expand Down Expand Up @@ -781,23 +781,24 @@ A list of all vanilla-lazyload features, compared with other popular lazy loadin

### vanilla-lazyload VS lazysizes

| It | vanilla-lazyload | lazysizes |
| ---------------------------------------------------------------------------------------- | ---------------- | ----------- |
| Is lightweight | ✔ (2.8 kB) | ✔ (3.4 kB) |
| Is extendable | ✔ (API) | ✔ (plugins) |
| Is SEO friendly |||
| Optimizes performance by cancelling downloads of images that already exited the viewport || |
| Retries loading after network connection went off and on again || |
| Supports conditional usage of native lazyloading || |
| Works with your DOM, your own classes and data-attributes || |
| Can lazyload responsive images |||
| ...and automatically calculate the value of the `sizes` attribute | ||
| Can lazyload iframes |||
| Can lazyload animated SVGs || |
| Can lazyload videos || |
| Can lazyload background images || |
| Can lazily execute code, when given elements enter the viewport || |
| Can restore DOM to its original state || |
| It | vanilla-lazyload | lazysizes |
| ------------------------------------------------------------------------------------------------------------------------ | ---------------- | ----------- |
| Is lightweight | ✔ (2.8 kB) | ✔ (3.4 kB) |
| Is extendable | ✔ (API) | ✔ (plugins) |
| Is SEO friendly |||
| Optimized for INP (uses `IntersectionObserver` instead of [these]https://gist.github.com/paulirish/5d52fb081b3570c81e3a) || |
| Optimizes performance by cancelling downloads of images that already exited the viewport || |
| Retries loading after network connection went off and on again || |
| Supports conditional usage of native lazyloading || |
| Works with your DOM, your own classes and data-attributes || |
| Can lazyload responsive images |||
| ...and automatically calculate the value of the `sizes` attribute | ||
| Can lazyload iframes |||
| Can lazyload animated SVGs || |
| Can lazyload videos || |
| Can lazyload background images || |
| Can lazily execute code, when given elements enter the viewport || |
| Can restore DOM to its original state || |

Weights source: [bundlephobia](https://bundlephobia.com/). Find others table rows explanation below.

Expand Down

0 comments on commit 8687059

Please sign in to comment.