Created
November 3, 2014 13:27
-
-
Save msikma/2a23f3c3a7fb5da49d86 to your computer and use it in GitHub Desktop.
jQuery Image load callback (IE6 compatible)
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
// requires jQuery 1.x | |
// image load callback that is compatible with IE6 | |
var $img = $('.some-selector img'); | |
var isIE6 = jQuery.browser.msie && parseInt(jQuery.browser.version) == 6; | |
$img.one("load", function() | |
{ | |
/* | |
image load event code goes here | |
*/ | |
}).each(function() | |
{ | |
if (this.complete || (isIE6)) { | |
$(this).trigger("load"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment