Php – Image loading using Lazy Load

imagejquerylazy-loadingPHP

I have used http://www.appelsiini.net/projects/lazyload this plugin to load the images.

It works fine when I scroll down the page images are loading but I need to display first row images when page is loaded.

How can I do this?

Best Answer

By default images are loaded when they appear on the screen. If you want images to load earlier you can set threshold parameter. Setting threshold to 200 causes image to load 200 pixels before it is visible.

$("img.lazy").lazyload({ threshold : 200 });

So in your case, how far is the first row down the page?

$(function() {
    var $firstRow = $('table:first tr:first'), 
    threshold = $firstRow.offset().top + $firstRow.height();
    $("img.lazy").lazyload({ threshold : threshold });
});

or something like that.