Click to See Complete Forum and Search --> : Help with rollovers


CrazyGaz
02-19-2003, 10:13 AM
I am trying to make it so that when you roll over the image another one appears but instead of loading every image doing
image1 = new Image(30,50)
image1.src = "home.gif"
etc.

I want to do it using functions where all I need is
<a href="/" onmouseover="swapout(home2); return true; onmouseout="swapBack(home); return true;"<img src=home.gif></a>

I have this code
-----------------------------------------

<head>



<script language=javascript>
window.defaultStatus = 'GazGamez';


function SwapOut(imgname)
{
document.imageflip.src = imgname + ".gif"; return true;
}


function SwapBack(imgname)
{
document.imageflip.src = imgname + ".gif"; return true;
}

</script>

</head>
<body>
<a
onmouseover="window.status='home';SwapOut(home2); return true"
onmouseout="window.status='';SwapBack(home)"
><img src=home.gif name=imageflip width=30 height=50 border=0></a>
</body>
----------------------------------------------

But am getting "home2" is undefined error.
HELP!

Thanks
Gaz

gil davis
02-19-2003, 10:18 AM
You need some more quotes:<a onmouseover="window.status='home';SwapOut('home2'); return true" onmouseout="window.status='';SwapBack('home')">