I am working on a page displaying several hundred images at once. I use the Lazy Load plugin to make the page load quickly. Everything works fine, but I added a jQuery UI slider so that users can zoom in / out by dragging the handle. If users compress images, it is possible that images that were previously below the crease are now moved to the visible area. Since scrolling did not occur, images are not loaded.
I added an event to load when dragging the size descriptor, but it causes the loading of ALL images, not just those that went into scope.
The code is pretty simple:
Here is the code for connecting the plugin.
$("#pplImages.lazy").lazyload({event : "LoadVisibleImages"});
function LoadVisibleImages() {
$("#pplImages.lazy").trigger("LoadVisibleImages");
}
And here is the code that starts the download from the slider
$( "#slider" ).slider({
min: 25,
max: 125,
value: 100,
slide: function( event, ui ) {
ResizeImages(ui.value);
}
}).slider().bind({
slidestop : function(event,ui) {LoadVisibleImages();}
});
What I'm looking for is a way to upload ONLY those images that are now viewable, not ALL the images on the page.
Can anyone see what I'm doing wrong?
user330366
source
share