Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A dumb pre-load image question, except in reverse 1

Status
Not open for further replies.

Lunytic

Technical User
Nov 20, 2003
21
0
0
US
I've been searching the threads, and can't find something like this.

I have an animated gif that I would like to show up on the page, it is about halfway down the page. The problem is it is big and slow on dialups and slows the rest of the page (which is the front page) down.

Is there a way to load this image LAST?

A few of the threads talk about preloading in relation to mouseovers - I've done some of that, but its always been at the top, and I would assume would be loaded first. Would it be a varition of that? Would the script block go on the bottom of the page?

I'm not looking for the best or latest and greatest way necessarily, just the simplist and easist to maintain in case someone else takes over the page.

Thanks!
 
Lunytic,

You could load a static version of the animated GIF as a placeholder, and then use the onLoad tag of the BODY to switch in the animated version... Something like:

Code:
<BODY onLoad=&quot;document.images.animatedPlaceholder.src = 'realImage.gif';&quot;>
...
<IMG SRC=&quot;placeHolder.gif&quot; WIDTH=&quot;x&quot; HEIGHT=&quot;y&quot; NAME=&quot;animatedPlaceholder&quot;>
...
</BODY>
 
That work wonderfully! Thanks! I would give you a gold star but they are only pink. Still one for you.
 
Chris,

A lot of hosting companies seem to have a cap on the number of simultaneous connections any one user/session are allowed - especially for image transfers, I believe. I've seen this set as low as 2 on many sites.

This means that most of the other static images on the site could possibly be held up while waiting for the animated one to download. Using a static image would (greatly) reduce this bottleneck, evem if the page formatted itself correctly.

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top