Skip to content

Instantly share code, notes, and snippets.

@cowboy
Created January 27, 2010 14:33
Show Gist options
  • Save cowboy/287877 to your computer and use it in GitHub Desktop.
Save cowboy/287877 to your computer and use it in GitHub Desktop.
(function ($) {
$.event.special.load = {
add: function( handler, data, namespaces ) {
if ( /^img$/i.test( this.tagName ) && ( this.complete || this.readyState === 4 ) ) {
// If element is IMG and has been cached by IE, trigger the event explicitly.
var event = jQuery.Event( 'load' );
event.data = data;
handler.call( this, event );
}
}
}
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment