How to get both background and non-background images using the imagesLoaded library.
May 9 |
I use the imagesLoaded javascript library to determine when and what images are loaded and to provide a status on a pre-loader status screen. The imagesLoaded library has the ability to gather information on background images, and non-background images using the 'background: true/false' argument. If you need to get both background and non-background images, just run it twice switching the background arguments. I highly recommend using this library when you want to provide a 'please wait' dialog and show the load progress of a graphically intense site.
// Get the parallax images (non-background images).
$('.images').imagesLoaded({
background: false
}).progress( function( instance, image ) {
loadProgress();
});
// Get the background images in the scenes.
$('.bcg').imagesLoaded({
background: true
}).progress( function( instance, image ) {
loadProgress();
});
Tags
Images Loaded LibraryThis entry was posted on May 9, 2019 at 1:35 AM and has received 1277 views.