[email protected]
Twitter
LinkedIn
YouTube
GitHub
  • Services
  • Blog
  • Repositories
  • GitHub
  • Resume
  • Contact
Product was added to your cart

Cart

jQuery: Load images as needed (lazy load)

August 7, 2015Front-Endjfadev

Upload all images to a page before opening it may be heavy in some cases. The solution in such cases can be one time loaded the page go gradually loading the set of images that are displayed in the time (lazy load). As is becoming scroll loads the images that you will need for its correct visualization.

If you are using the library jQuery, we can use the plugin jQuery LazyLoad to simplify this task.

<html>
    <head>
        <script src="jquery-1.11.1.js"></script>
        <script src="jquery.lazyload.js"></script>
        
        <script type="text/javascript">
            $(document).ready(function() {
                $("img.lazy").lazyload({
                    effect : "fadeIn"
                });
            }); 
        </script>
    </head>
    <body>
        <img class="lazy" data-original="img1.jpg" width="640" height = "480"/>
        <img class="lazy" data-original="img2.jpg" width="640" height = "480"/>
        <img class="lazy" data-original="img3.jpg" width="640" height = "480"/>
    </body>
</html>

Doc: here

Download: here

: jQuery, JS, Web Developement

Services

  • Excel2chatGPT $10.00
  • Bot Tok $45.00
  • Fix bugs in your PHP Symfony App $70.00 / hr
  • Fix bugs in your Wordpress Site $70.00 / hr
  • Tasks Automation using Node.js $70.00 / hr

Blog

  • How to Pay with a Bank Card on Cryptomus
  • Complete Beginner’s Guide to Bot Tok: Terminal Commands Explained
  • Top Site to Gain Views on TikTok
  • Jfa Whatsapp Chatbot
  • TikTok Bot

Explore

  • Free 10 Tiktok Likes
  • Free 2K TikTok Views
  • Free 100 TikTok Favorites
  • Free 300 TikTok Shares
  • Buy TikTok Views
  • Free 100 Instagram Likes
Twitter
LinkedIn
YouTube
GitHub

© 2013-2025 Jordi Fernandes Alves (@jfadev)