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=http://www.webdeveloper.com/forum/archive/index.php/"/" 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=http://www.webdeveloper.com/forum/archive/index.php/home.gif name=imageflip width=30 height=50 border=0></a>
</body>
----------------------------------------------
But am getting "home2" is undefined error.
HELP!
Thanks
Gaz
image1 = new Image(30,50)
image1.src = "home.gif"
etc.
I want to do it using functions where all I need is
<a href=http://www.webdeveloper.com/forum/archive/index.php/"/" 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=http://www.webdeveloper.com/forum/archive/index.php/home.gif name=imageflip width=30 height=50 border=0></a>
</body>
----------------------------------------------
But am getting "home2" is undefined error.
HELP!
Thanks
Gaz