Created
December 27, 2014 15:32
-
-
Save robpataki/3658e064d53c3b6ddc67 to your computer and use it in GitHub Desktop.
jQuery image load handling
This file contains 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
var img = new Image(); | |
$(img).on('load', function(e){ | |
// Your code here | |
}).each(function() { | |
if(this.complete) $(this).load(); | |
}); | |
img.src = "http://dummyimage.com/600x400"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment