You can use the LazyLoad plugin to upload images only when they are in the visible area of your browser screen.
The advantage of this is that there is a performance gain on page load and also saves users' internet bandwidth consumption, even more when they access your site via 3G or 4G. p>
Using Lazy Load is simple. Just add the script to <head>
of your page:
<script language="javascript" src="jquery.lazyload.js"></script>
Then add the class .lazy
to the images that will be affected:
<img class="lazy" data-original="imagem_real.png" src="imagem_pre.png" />
And call the function in the script:
<script>
$(function(){$("img.lazy").lazyload();});
</script>
Notes:
-
data-original
is the path of the final image, which will be loaded
when the area it is in is within the visible area of the
browser.
- In% with% you put the path of a generic image, which will be
pre-loaded before the final image (create a lighter image
possible as a 1x1 pixel png, for example).
Download the plugin and see the documentation on the link
link