I am creating a jQuery plugin.
How do I get the real image width and height with Javascript in Safari?
The following works with Firefox 3, IE7 and Opera 9:>
$("#myImg").one("load",function(){ //do something, like getting image width/height }).each(function(){ if(this.complete) $(this).trigger("load"); });
From Chris' comment: http://api.jquery.com/load-event/