Side navigation
#7823 closed bug (duplicate)
Opened December 21, 2010 10:03PM UTC
Closed December 21, 2010 11:24PM UTC
Last modified December 21, 2010 11:24PM UTC
load event fires too soon
Reported by: | rasmus@mindplay.dk | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.6 |
Component: | manipulation | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Example:
$('<img src="/images/test.jpg"/>').load(function(){ $(this).hide().show('slow'); })
This does not actually work - because the event may fire when the image has loaded, but in Firefox (3.6.13) that does not mean the image has actually been displayed, just that it's in-memory. In other words, the width and height aren't known yet.
It seems like some special handling is required for images here for this function to be truly useful - while this event will tell you when the image has been loading, that is typically besides the point. What you usually need to know is when the image is actually loaded and ready for you to manipulate.