I need to get an image’s dimensions in javascript (jQuery) when no styles are specified for it (jQuery’s css() returns 0).
Maybe it is because I’m loading the image with jQuery just before asking for its dimensions. If this is the case, is there any event to listen that tells when the image has been loaded?
Maybe the image has not fully loaded therefore the dimensions can not be given.But without your code I can’t tell what you’re doing wrong, but here is an Example that would work: