i use this plugin for jquery layz http://jquery.eisbehr.de/lazy/
but browser downloading twice the images;
i see this browser downloading twice the images when lazy loading with js
but this cant help me
my code:
jQuery('.image img').Lazy({
afterLoad: function (element) {
element[0].style.opacity = 1;
element.parent().addClass('loaded-image');
element.parent().removeClass('image');
},
// your configuration goes here
scrollDirection: 'vertical',
effect: 'fadeIn',
visibleOnly: true,
onError: function (element) {
console.log('error loading ' + element.data('src'));
}
});