Basically what I'm looking for is performance here.
$.post(link,
function(data){
$("#loadingImg").remove();
$("#content").append('<div id="new-page">' + data + '</div>');
$("#new-page").find("img").lazyload({
placeholder : "/images/white.png", effect : "fadeIn" });
});
I want to use the jquery plugin, lazy loading , to lazy loading images that are added to some content. Now I can say that the loading time with the lazyload line of this code and without it is exactly the same (loading about 20 images). I assume the string is $ ("# content"). Append () waits for all images to load before uploading.
Is there a way to place html on a page, stop the browser from loading images in that html, and then load them as custom scrolls?
By the way, even when I do:
data = '<div id="new-page-' + pageCounter + '">' + data + '</div>';
var newData = $(data);
newData.find("img").lazyload({ placeholder : "/images/white.png", effect : "fadeIn" });
$("#content").append(newData);
It takes as much time to download ...
Thanks for the help!