Good evening,
I have a webpage that changes the image when you mousover another image and I was wondering if I could preload the images to make it faster. it takes about 2.5 seconds to change the image. Should I set my meta tags to cache? The page is at http://www.ribbb.com/images/catologimages/poolcues/viking/2007/g60-g69/g60-g69.html
I am not trying to sight advertise I just needed some input.
thanks
Dave

Hi there
I think you just need a little javascript routine that reads the image files inside the head part of your page. This will cause the images to be read by the browser before the rest of the page is and they will thus be ready when the page has loaded.

For example
<SCRIPT LANGUAGE = JAVASCRIPT>
if (document.images)
{
img1 = new Image();
img1.src = "overbutton.png";
img2 = new Image();
img2.src = "outbutton.png"
}
</script>

Hope this helps. 8-)

Hi there
I think you just need a little javascript routine that reads the image files inside the head part of your page. This will cause the images to be read by the browser before the rest of the page is and they will thus be ready when the page has loaded.

For example
<SCRIPT LANGUAGE = JAVASCRIPT>
if (document.images)
{
img1 = new Image();
img1.src = "overbutton.png";
img2 = new Image();
img2.src = "outbutton.png"
}
</script>

Hope this helps. 8-)

thanks but would that cause the page to load slower? Appreciate the advice

Yes, unfortunately it will. You have the choice of either the page loading slower initially and the mouseover image change happening instantly, or the page loading a little faster and the images taking longer to show when you mouseover.

Another trick would be to load the full size images and render them small.

If I am looking at your page, I would very much prefer that the images stay larger all the time. I hate jumpy things happening when the mouse goes over something. They usually make me hit my back button immediately.

And it's worse if the expanded image from one mouseover image covers another one, which is the one I want. If I have to do a lot of jiggerrymousery to get to the one I want, I just leave instead.

Another trick would be to load the full size images and render them small.

If I am looking at your page, I would very much prefer that the images stay larger all the time. I hate jumpy things happening when the mouse goes over something. They usually make me hit my back button immediately.

And it's worse if the expanded image from one mouseover image covers another one, which is the one I want. If I have to do a lot of jiggerrymousery to get to the one I want, I just leave instead.

I understand what you are saying. The images just jump up in a designated area that is why the butts of the cues are horizontal. It's not my website I just do what I am told, thanks for the advice though

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.