PDA

View Full Version : image rollover



sam_baird2003
08-11-2004, 09:44 AM
im trying to get a rollover to work but it wont this is the script
images/home.gif (home.html)
is there any erros in it

Greg S
08-11-2004, 10:39 AM
Use javascript:

<html>
<head>
<title></title>
<script language="javascript">
<!-- This script works in: Navigator 3 - 4, Opera 3.1, and Explorer 4

if (document.images) {
teston = new Image(); // Active images
teston.src = "test.on.gif";

testoff = new Image(); // Inactive images
testoff.src = "test.off.gif";
}

function imgOn(imgName) {

if (document.images) {
document.src = eval(imgName + "on.src");
}
}

function imgOff(imgName) {
if (document.images) {
document[imgName].src = eval(imgName + "off.src");
}
}

// -->
</script>

</head>
<body>



[img]test.off.gif (testcss.html)