Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/landofcoder/module-lazyload
free magento 2 lazyload images
https://github.com/landofcoder/module-lazyload
lazyload-images magento2 magento2-extension magento2-extension-free
Last synced: 11 days ago
JSON representation
free magento 2 lazyload images
- Host: GitHub
- URL: https://github.com/landofcoder/module-lazyload
- Owner: landofcoder
- License: mit
- Created: 2021-03-30T10:34:56.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-30T15:38:15.000Z (almost 4 years ago)
- Last Synced: 2024-12-05T14:39:56.739Z (28 days ago)
- Topics: lazyload-images, magento2, magento2-extension, magento2-extension-free
- Language: PHP
- Homepage: https://landofcoder.com
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lof_Lazyload
## Overview
A Magento 2 module that adds support for lazy loading of images.## Features
* Utilises the [lazysizes](https://github.com/aFarkas/lazysizes) script to add lazy load support for images
* Lazy loading is automatically applied to all\* product images
* \*Any image created via `Magento\Catalog\Block\Product\Image`
* This includes:
* Product listing (category, search, product list widget)
* Product relations (related, upsell, crosssell)
* Product comparison
* Recently viewed
* Cart thumbnails
* Wishlist
* Support can be added to any further images by adding the following to `` elements:
* Add `lazyload` class
* Change the `src` attribute to `data-src`
* Optional: add a dummy `src` with transparent 1px x 1px image to avoid broken image links prior to lazy load (see product image templates as example)
* Preloading
* Preloading means the media source will be loaded even if not in the viewport such as megamenu icons/images.
* The `preload_elements` layout argument allows you to specify selectors of which elements can be preloaded. This can be configured per page.
* Use the `lazypreload` class on element(s) you wish to preload.## Compatibility
* Magento Community Edition / Enterprise Edition 2.2.x (see older releases for 2.0 / 2.1 support)
* Supports Magento 2 Full Page Cache (including Varnish)## Installation
```
composer require landofcoder/module-lazyload
php bin/magento module:enable Lof_Lazyload
php bin/magento setup:upgrade
```## Contributing
Issues, forks and pull requests welcomed :)