J
Jeff
I get the following error when I try to rollover my button:
document.images[imgName] has no properties Line: 22
Am I doing this correctly? Suggestions? This is using Netscape 7.2
on Fedora core 4.
Here's my simple html file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
<!-- HIDE
if (document.images)
{
document.images["order1"] = new Image(135,40);
document.images["order1"].src = "images/ordernow1.jpg";;
document.images["order2"] = new Image(135,40);
document.images["order2"].src = "images/ordernow2.jpg";;
}
function rollover(imgName,src)
{
if (document.images)
{
document.images[imgName].src = src;
return false;
}
return true;
}
// DONE hiding -->
</script>
</head>
<body>
<a href="http://www.mysite.com/order.html"
onMouseover="return rollover('order2','images/ordernow2.jpg');"
onMouseout="return rollover('order1','images/ordernow1.jpg');">
<img src="images/ordernow1.jpg">
</a>
</body>
</html>
document.images[imgName] has no properties Line: 22
Am I doing this correctly? Suggestions? This is using Netscape 7.2
on Fedora core 4.
Here's my simple html file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
<!-- HIDE
if (document.images)
{
document.images["order1"] = new Image(135,40);
document.images["order1"].src = "images/ordernow1.jpg";;
document.images["order2"] = new Image(135,40);
document.images["order2"].src = "images/ordernow2.jpg";;
}
function rollover(imgName,src)
{
if (document.images)
{
document.images[imgName].src = src;
return false;
}
return true;
}
// DONE hiding -->
</script>
</head>
<body>
<a href="http://www.mysite.com/order.html"
onMouseover="return rollover('order2','images/ordernow2.jpg');"
onMouseout="return rollover('order1','images/ordernow1.jpg');">
<img src="images/ordernow1.jpg">
</a>
</body>
</html>