vl

vtex-lazyload

Lazyload for Vtex Components

Showing:

Popularity

Downloads/wk

6

GitHub Stars

10

Maintenance

Last Commit

4yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

3.6KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Vtex Lazyload

A Lazysizes based plugin Lazyload for Vtex Components.

Instalation

$ npm install vtex-lazyload or download the file

<script type="text/javascript" src="/arquivos/vtex-lazyload.min.js"></script>

Usage

After import/call files on page, its initialize automatically

<!-- Vitrine -->
<div class="your-class js--lazyload has--lazyload" data-noscript="">
  <noscript>$product.GetImageTag(30)</noscript>
</div>
<!-- Placeholder -->
<div class="your-class js--lazyload has--lazyload" data-noscript="">
  <noscript><vtex:contentPlaceHolder id="Main-Banner" /></noscript>
</div>

Setting custom styles

You can use the following classes to custom style:

.is--lazyloaded { /* Uses when element is visible */ }
.has--lazyloading { /* Uses when element is loading */ }
.has--lazyerror { /* Uses when element has an error */ }

License

Vtex Lazyload and Lazysizes is open-sourced software licensed under the MIT license.

Credits

Lazyzises and all contributors!

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial