![]() |
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. |
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.
|
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