Preload Image for MouseOver
I made some pretty cool looking buttons in Photoshop, saved them for web (about 4K) but when I put them on the web, the mouseover didn't work as good as I had anticipated. Here what I have in code.
<script language='JavaScript'>
var overOut = false
function imgSwap(src)
{
newName=src.name + "over.gif"
if (!overOut)
{
src.src=orderover.gif
overOut=true
}
else
{
src.src=src.name + '.gif'
overOut=false
}
}
</script>
<body>
<a href='http://www.whatever.com'><img src='order.gif' border='0' name='order' onMouseOver='imgSwap(this)' onMouseOut='imgSwap(this)'></a>
Is there a way to perhaps preload all the images onLoad of the page so that it's not looking for the new image everytime?
Thanks
:cool: