Im using http://desandro.github.com/imagesloaded/ imagesLoaded plugin which works great for detecting when a div's images have loaded:
$('.background').imagesLoaded(function() {
console.log('background loaded');
});
I need this to also check when a background-image applied via CSS has been loaded as the above plugin doesnt seem to listen for background-images.
Any ideas?
$('<img>').attr('href', 'urlHere.jpg').imagesLoaded(function(){ console.log('backgroundImage loaded, apply as BG'); });might work?