Make images load when they enter visible section of browser? [closed] Make images load when they enter visible section of browser? [closed] ajax ajax

Make images load when they enter visible section of browser? [closed]


"wp-content/plugins/jquery-image-lazy-loading"

Lazy loader is a jQuery plugin written in JavaScript. It delays loading of images in (long) web pages. Images outside of viewport (visible part of web page) wont be loaded before user scrolls to them. This is opposite of image preloading.

Using lazy load on long web pages containing many large images makes the page load faster. Browser will be in ready state after loading visible images. In some cases it can also help to reduce server load.

http://www.appelsiini.net/projects/lazyload

So it seems it goes through every image specified or inside of the context of an element and replaces the src with a placeholder gif before the images fully load, saves the original URI and when the image is "visible" it replaces the placeholder with the real image.


LazyLoad is no longer available according to the website. Apparently the code no longer works on new browsers and the author doesn't have time to update it.

The "appear" plug in is working well for me.

http://plugins.jquery.com/appear/

It allows you to specify a callback function for an element. The callback function is called when the element appears into view. From the site:

$('#foo').appear(function() {  $(this).text('Hello world');});


If you look at the source of the page you referenced, it contains this bit of code:

jQuery(document).ready(function($){  jQuery(".SC img").lazyload({    effect:"fadeIn",    placeholder: "http://blogof.francescomugnai.com/wp-content/plugins/jquery-image-lazy-loading/images/grey.gif"  });});

I suspect that's how they're accomplishing the effect. It uses the jQuery LazyLoad plugin, which can be found here:

http://www.appelsiini.net/projects/lazyload