Tilted Forum Project Discussion Community

Tilted Forum Project Discussion Community (https://thetfp.com/tfp/)
-   Tilted Technology (https://thetfp.com/tfp/tilted-technology/)
-   -   mouseover help (https://thetfp.com/tfp/tilted-technology/86728-mouseover-help.html)

limey 04-06-2005 08:53 AM

mouseover help
 
I am using a really basic mouseover script to change a linkable image when the mouse runs over it. The script works fine on my local computer but after I upload the page to my host it takes ages for the image to swap to the second image. I have tried using a Javascript but get the same results.
Here is the code that I am using now. I thought it would be best as it was the most basic;
<a href="page1.htm"><img src="graphics/image1.jpg" border="0" onmouseover="src='graphics/image2.jpg'" onmouseout="src='graphics/image1.jpg'"></a>

Is this just a problem with my host or my connection or is there a faster way to do this.
Thanks.

a-j 04-06-2005 09:43 AM

I would guess, the image isn't being loaded until the mouseover event is triggered. There are probably ways to preload the image, but I don't know much about javascript to tell you the answer.

Silvy 04-06-2005 02:08 PM

Try loading the image in javascript, on document load.
put something like this in the head section of your document:

<script type="text/javascript">

preloadImg = new Image()
preloadImg.src = "yourimage.png"
</script>


All times are GMT -8. The time now is 01:31 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38