downloading images - checking when the image is complete

They have: 5,633 posts

Joined: Jan 1970

I have an image on a page that will change its source regularly. Is there any way to detect when the
new image has been fully downloaded? After I know the image has been fully downloaded I want to run another script.

Does anything exist such as document.loaded? or document.complete?

I have played around with setTimeout() which automatically changes the image source at a regular interval. BUT if the image has not fully downloaded before calling the new image, the browser will slow down and the images will not display properly.

Maybe you can do this with frames? Any suggestions?

----------
[email protected]
http://go.to/hass

They have: 2,390 posts

Joined: Nov 1998

Sorry, no idea Sad
JP

----------
[red]The Next Step in Website Development [/red] - http://www.what-next.com
The Webmaster Promotion and Resource Center

They have: 5,633 posts

Joined: Jan 1970

I have found the solution. What I did was to write a document to a hidden frame which contained the image I wanted to download. When writing to the hidden frame I added an onLoad="" to the body tag which called another script. Sounds a bit complicated and it took a while to get it working.

Check out the result at
http://home.primus.com.au/123/lloydhass/kodak/wall.html

I have not tested this script fully yet. If you have any JavaScript errors or have any comments/queries please let me know.

----------
[email protected]
http://go.to/hass

They have: 2,390 posts

Joined: Nov 1998

wow works brilliantly....
JP

----------
[red]The Next Step in Website Development [/red] - http://www.what-next.com
The Webmaster Promotion and Resource Center

They have: 5,633 posts

Joined: Jan 1970

I have been getting a javascript error from this page. This happens when you exit the page then use the browser Back button to visit again. This also happens when you presh the refresh button. I think that the problem is that the frames do not reload.

My question is how do you get each frame within a frameset to reload?

----------
[email protected]
http://go.to/hass

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.