This is a discussion on "Pre-Load Images" within the JavaScript Forum section. This forum, and the thread "Pre-Load Images are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Pre-Load Images
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Pre-Load Images
Hello Members:
I'm sure this is a simple script, but how can you pre-load images when the page loads? I have hover images that I would like pre-loaded so users don't have to wait for the second image to appear on hover. Thanks & Regards, Mike |
|
|
|
|||
|
Try this:
|
|
|||
|
Is there a requirement as to if I put it in the HEAD or the BODY?
|
|
|||
|
Head.
|
|
|||
|
Thanks!
|
|
|||
|
I tried using your script, and in the HEAD section, but it doesn't seem to work for me...
Here is the script exactly how it appears in my source code along with the URL for you to look at. Maybe it's just my computer? URL: http://WiseWizards.tripod.com/Develo.../Pictures.html Source Code:
Mike |
|
|||
|
Change i<=3 to i<=image_url.length
|
|
|||
|
Is this correct:
Mike |
|
|||
|
Looks right to me.
|
|
|||
|
It still doesn't seem to work for me. It would say in the status bar that it was downloading the images I set to preload, correct? Could you see if anything different comes up on your computer? This is the 4th script I've tried, so I'm starting to think it's either my computer or my web host. Thanks for your patience, though!
Regards, Mike |
|
|||
|
I don't think it does show in the status that it's downloading them.
|
|
|||
|
Try it in IE. Empty the cache and see if the preloaded images work immediately. Catalyst is right that the images do not show in the status bar.
|
|
|||
|
I've already tried clearing cookies, cache, temporary files, etc. I am using Internet Explorer 6.0 and have tried another computer on my network to see if anything different comes up--it didn't.
You say it won't show in the status bar? Regards, Mike |
|
|||
|
|
|||
|
Well, I got somewhere...
I replaced the old script with the new one, and I saw the picture URL's in the status bar, but when I hovered over the hover images only the last pre-loaded images actually pre-loaded. The status bar looked like this: 001_Small2.png002_Small2.png003_Small2.png004_Smal l2.png005_Small I'm sorry this is such a continuous problem! If we can't figure something out, I dont' REALLY need the script. It would just be more web design like if you know what I mean. Regards, Mike P.S. From my experience in CSS, putting the ";" inside the quotations wouldn't have anything to do with it, would it? |
|
|||
|
So it looks like it's preloaded your images. I'm not sure where the problem still is?
|
|
|||
|
Are you not sure where the problem is in the script or what the problem is in general?
In my browser, only the last image specified in the pre-load script actually pre-loaded. I know this because the hover images other than the last one took around 4 seconds to come up whereas the the last hover image instantly appeared when I placed my cursor over the image. Any thoughts? If not, like I said, no problem. I guess I'll just have to do without. Regards & Thanks, Mike |
|
|||
|
I'm thinking the problem is in your rollover script and not the preloader. Can you post that?
|
|
|||
|
Sure! Here's my hover script:
There are 23 of these. Regards, Mike |
|
|||
|
Try this instead, it's the preloader/rollover script I use for all my sites.
In the HEAD put (and of course put all 23 images in the list)
Change the numbers in menu(#, and r# using 1 to 23 |
![]() |
| Tags |
| preload, images |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Load Last | fizzgig | JavaScript Forum | 5 | Sep 20th, 2007 20:07 |
| Getting Div to show on load | pa007 | JavaScript Forum | 1 | Aug 25th, 2007 17:15 |
| Forcing JavaScript to load before images? | JennyChaos | Starting Out | 14 | Jul 13th, 2007 23:02 |
| How to ensure important images load first? | snappy | Web Page Design | 16 | Nov 15th, 2006 15:14 |
| HELP!!! Images won't load IE 6 | Lilas | Graphics and 3D | 1 | Dec 23rd, 2005 18:08 |