Giter VIP home page Giter VIP logo

module-lazyload's Introduction

Total Downloads Latest Stable Version

Features

  • Allow to load images on your store only when customer can see them. Module reduces page size and number of request.

Compatibility

Configuration

Requirements

  • Magento Community Edition 2.0.x-2.4.x or Magento Enterprise Edition 2.0.x-2.4.x

Installation

Demo

Try out our open demo and if you like our extension please give us some star on Github ★

Storefront Demo Admin Panel Demo
Magento 2 Image Lazy Load Extension Storefront Demo Magento 2 Image Lazy Load Extension Admin Panel Demo
view view

Support

If you have any issues, please contact us then if you still need help, open a bug report in GitHub's issue tracker.

Please do not use Magento Marketplace's Reviews or (especially) the Q&A for support. There isn't a way for us to reply to reviews and the Q&A moderation is very slow.

License

The code is licensed under EULA.

Magento 2 Point of Sale

Magento 2 Theme

module-lazyload's People

Contributors

andriysvyryda avatar bohdan-berezhniy avatar ihormandzyuk avatar ihorvansach avatar kozakserhii avatar magefan avatar simonrl avatar termos008 avatar tjitse-e avatar yuriyhamulevych avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

module-lazyload's Issues

Lazyload Megamenu Images

First, thanks for your great plugin!

I need apply lazyload on the images inside a mega menu that is in the header.
The images in mega menu are not seen unless "hovering" over a particular category in the menu. Also, the mega menu is above the fold and doesn't need scrolling down the page which presents another challenge.

Is there a way to implement lazyload for a menu that is in header (doesn't need scroll) and has images within menu that shall be displayed after triggering a “hover” state.

This scenario is sort of similar to product page tabs, where the images are lazyloaded and generated/displayed not after scrolling down the page to that section, but only after opening the particular tab.

Thanks!

error when install with Magento 2.4.6

When install with Magento 2.4.6 will got this message when setup:upgrade.
call_user_func(): Argument #1 ($callback) must be a valid callback, class "Magefan\LazyLoad\Setup\Patch\Data\ConvertConfigToJsonPatch" not found#0

Images changing on hover

Hello,

I'm using the last version of the module.
Magento CE 2.3.3.

i'm using the following HTML to show a different image on hover.
<a href="https://www.youtube.com/user/LaMaisonDuCanevas" class="youtube social-link"> <img src="https://preprod.canevas.com/pub/static/version1584693125/frontend/Lmc/default/fr_FR/images/cms/footer/ytube.png" data-original="https://preprod.canevas.com/pub/static/version1584693125/frontend/Lmc/default/fr_FR/images/cms/footer/ytube.png" alt="" class="loaded" data-was-processed="true"> <img src="https://preprod.canevas.com/pub/static/version1584693125/frontend/Lmc/default/fr_FR/Magefan_LazyLoad/images/pixel.jpg" data-original="https://preprod.canevas.com/pub/static/version1584693125/frontend/Lmc/default/fr_FR/images/cms/footer/ytube_hover.png" class="_active" alt=""> </a>
The first image is displayed initially and the second one is not displayed (display: none).
The issue is that, the src of the second image which appears on hover is still the pixel url. It does not change for the data original one.

Thanks,
Pierre

No space between attributes

Error thrown on validator.w3.org and caused in Magefan\LazyLoad\Plugin\BlockPlugin, L80-81:

"data-original" gets added directly after the src attribute, resulting in no space between the two IMG attributes.

Expected:
<img src="..." data-original="..." />

Actual result:
<img src="..."data-original="..." />

(note the missing space)

Would you release a new version if I create a PR? We're using the module via composer, so it would be nice to have that fix in the code.

Thanks
Simon

[Solved] After x time, no image loading...

Hello,
I dont understand anything to this issue..

Lazyload is applied without problem to my catalog, awesome !

But after X time, all the images are missing when i clear the cache of my browser.
The only way to resolve the problem is to clear static files cache.

Any idea ?

magento 2.2.6. Cache clean, setup:upgrade, setup di:compile done

Bug if there is no img tag src attribute

In case of there is img without src attribute regex in \Magefan\LazyLoad\Plugin\BlockPlugin::afterToHtml is too "hungry" and "eat" all over img tag.
Example:

<div class="new-bestseller-block-main">
<div class="new-block">
<div class="new-block-inner">
<div class="content">
<div class="img-right"><img test="test-2.png" alt=""></div>
</div>
</div>
<div class="best-seller-block">
<span>
        <img class="product-image-photo"
                        src="test.jpg"
            max-width="201"
            max-height="188"
            alt="" /></span>
</div>
<span>
        <img class="product-image-photo"
                        src="test_1.jpg"
            max-width="201"
            max-height="188"
            alt=""/>
</span>

Lazy loading images with knockout

Hi,

I'm on magento 2.3 opensource.
I try to apply the lazyloading for images define into js knockout template.

<img data-bind="attr: {src: thumbnail, alt: code_article, loading: 'lazy', width: '165', height: '165' }"/>

First, I find that the lazyloading does not work. It's because the module does not manage it. So, try the following to have the lazyloading :

<img data-bind="attr: {src: $parent.getPixelUrl(), 'data-original': thumbnail, alt: code_article, loading: 'lazy', width: '165', height: '165' }"/>
where the getPixelUrl returns the same string than $block->getViewFileUrl('Magefan_LazyLoad::images/pixel.jpg')

It does not work again. Anybody has an idea ?

Thanks

Missing required argument $skipBlocks of Magefan\\LazyLoad\\Plugin\\BlockPlugin.

We are facing the following exception in the checkout(Magento version: 2.4.5-p1),

{"0":"Missing required argument $skipBlocks of Magefan\LazyLoad\Plugin\BlockPlugin.","1":"#1 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]\n#2 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]\n#3 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#4 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/Interception/PluginList/PluginList.php:174]\n#5 Magento\Framework\Interception\PluginList\PluginList->getPlugin() called at [vendor/magento/framework/Interception/Interceptor.php:144]\n#6 Magento\Cms\Block\Block\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#7 Magento\Cms\Block\Block\Interceptor->___callPlugins() called at [generated/code/Magento/Cms/Block/Block/Interceptor.php:230]\n#8 Magento\Cms\Block\Block\Interceptor->toHtml() called at [pub/errors/default/503.phtml:24]\n#9 require_once() called at [pub/errors/default/page.phtml:22]\n#10 require_once() called at [pub/errors/processor.php:437]\n#11 Magento\Framework\Error\Processor->_renderPage() called at [pub/errors/processor.php:231]\n#12 Magento\Framework\Error\Processor->process503() called at [pub/errors/503.php:11]\n#13 require() called at [vendor/magento/framework/Session/SaveHandler/Redis.php:100]\n#14 Magento\Framework\Session\SaveHandler\Redis->read() called at [vendor/magento/framework/Session/SaveHandler.php:212]\n#15 Magento\Framework\Session\SaveHandler->callSafely() called at [vendor/magento/framework/Session/SaveHandler.php:125]\n#16 Magento\Framework\Session\SaveHandler->read()\n#17 session_start() called at [vendor/magento/framework/Session/SessionManager.php:186]\n#18 Magento\Framework\Session\SessionManager->start() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#19 Magento\Framework\Session\Generic\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#20 Magento\Framework\Session\Generic\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#21 Magento\Framework\Session\Generic\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/Session/Generic/Interceptor.php:41]\n#22 Magento\Framework\Session\Generic\Interceptor->start() called at [vendor/magento/framework/Session/SessionManager.php:123]\n#23 Magento\Framework\Session\SessionManager->__construct() called at [generated/code/Magento/Framework/Session/Generic/Interceptor.php:14]\n#24 Magento\Framework\Session\Generic\Interceptor->__construct() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121]\n#25 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:66]\n#26 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#27 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170]\n#28 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276]\n#29 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239]\n#30 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]\n#31 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]\n#32 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#33 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170]\n#34 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276]\n#35 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239]\n#36 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]\n#37 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]\n#38 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#39 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170]\n#40 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276]\n#41 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239]\n#42 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]\n#43 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]\n#44 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#45 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:206]\n#46 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:182]\n#47 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276]\n#48 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239]\n#49 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]\n#50 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]\n#51 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#52 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/App/FrontController.php:109]\n#53 Magento\Framework\App\FrontController->__construct() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:14]\n#54 Magento\Framework\App\FrontController\Interceptor->__construct() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121]\n#55 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:66]\n#56 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#57 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/App/Http.php:115]\n#58 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]\n#59 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]\n#60 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30]\n","url":"/inventory_catalog/product/getQty/?sku=94741-750-AI&channel=website&salesChannelCode=base&=1714961102632","script_name":"/index.php","report_id":"f10d1f4e031a3ae2ebf3479ca17cb88e990cdad79f9a3aca8b0d1292b4f91604"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.