View Full Version : help with image rollover


hilikus21
01-10-2005, 08:53 PM
hi, i'm doing an image rollover for 6 different images on one page. I know how to do this but all of the scripts i've found and written won't innitially display an image (just that nasty little space holder thing. here is a sample of the script i'm using (it's just for the first image)

<script language="JavaScript" type="text/javascript">

img0_on = new Image(116,109);
img0_on.src="home2.gif";
img0_off = new Image(116,109);
img0_off.src="home1.gif";

function over_image(parm_name)
{
document[parm_name].src = eval(parm_name + "_on.src");
}
function off_image(parm_name)
{
document[parm_name].src = eval(parm_name + "_off.src");
}
</script>




and what i put in body:

<a href="home.html" onmouseover="over_image('img0');" onmouseout="off_image('img0')"> <img src="home2.html" border="0" name="img0"></a>


i use explorer 5.0, could it be a browser thing? am i missing something?
thankee!