Important

Okay
  Public Ticket #1180774
Technical Questions on Lazy Loading Plugin
Closed

Comments

  • Khaleel Mughal started the conversation

    Hi

    Thank you for releasing such a great plugin. Please can you answer some questions.

    I wish to use the lazy-loading on other pages, I plan to edit my custom theme image classes and code.

    My Old code is like

    <img src="file.jpg">

    So do I need to do A:

    <img data-src="file.jpg" class="lof-lazy">

    or B (both data-src attribute and src attribute)

    <img data-src="file.jpg" src="file.jpg" class="lof-lazy">

    Last question: Does SVG files support work?

  •  1,319
    Land of replied

    Hi Mate,

    Thanks for using the extension in your site. Please use the A method

    <img data-src="file.jpg" class="lof-lazy">
  • Khaleel Mughal replied

    Ah I thought I needed to use the helper each time. So I don't need to show a preloading icon ???

    <?php
    $helper      = $this->helper('Lof\LazyLoad\Helper\Data');
    $loadingIcon = $helper->getConfig('general/loadingIcon');
    $imgSrc      = $helper->getMediaUrl() . 'lof/lazyload/default/' . $loadingIcon;
    ?>

    <img data-src="<?php echo $imgSrc; ?>"

  •  1,319
    Land of replied

    Yes, you're right

  • Khaleel Mughal replied

    Last question:


    Threshold: 800

    Amount of pixels below the viewport, in which all images gets loaded before the user sees them.

    Does this mean if I am on a mobile phone and the resolution is 800x600 but the page is 1200. Only the images in the 800 load? And when I scroll outside of 800 then it shows more??

  •  1,319
    Land of replied

    Hi Mate

    The threshold is the amount of pixels outside of the seeable browser window, where the plugin should start loading the images. For example, a threshold of 500 means, that images in the area of your browser bottom plus 500px will be loaded. I'll hope understand what I want to tell you. We're using the lazy library http://jquery.eisbehr.de/lazy/

  • Khaleel Mughal replied

    Mark as sold please