What's the event for an image to start downloading?

Viewed 969

I know jQuery.load(), it's fired when an <img> has completed downloading.

I'd like to know what event is fired when the browser starts downloading the image. Normally at the first moment, the browser knows the size of the picture, and then it takes a while (depending on the picture size) for the picture to download.

I'd like to attach an event to know the picture size as soon as browser knows it, or as soon as the browser starts downloading it.

[EDIT]

Thank you for the idea from @jfriend00, now I use setInterval to check the size. BUT not the size of picture, some browser just not tell before finish downloading. So I check the size of container. Once picture size known by browser, it will adjust container size. Wala, done.

2 Answers
Related