Created
June 16, 2011 15:06
-
-
Save gavinblair/1029443 to your computer and use it in GitHub Desktop.
Trigger an event after specific background images have been loaded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('<img>').attr('src',function(){ | |
return $('#mydiv1').css('background-image'); | |
}).load(function(){ | |
$('<img>').attr('src',function(){ | |
return $('#mydiv2').css('background-image'); | |
}).load(function(){ | |
$('<img>').attr('src',function(){ | |
return $('#mydiv3').css('background-image'); | |
}).load(function(){ | |
//done loading background images of all 3 divs | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
idea from http://stackoverflow.com/questions/3281651/trigger-event-on-background-image-load