Created
May 10, 2014 00:10
-
-
Save siriokun/8a11059e5f9f018b5a9b to your computer and use it in GitHub Desktop.
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
//jQuery | |
$("#swapImg") | |
.attr("src", "dynamic-image-url.jpg") | |
.one("load",function(){ | |
//image has loaded | |
}) | |
.each(function(){ | |
if(this.complete) //trigger load if cached in certain browsers | |
$(this).trigger("load"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment