Danno13
12-24-2002, 12:56 PM
I am trying to make a navigation bar where each button fades from black to white onmouseover. This is what i have so far:
<html>
<head>
<title>New Page 1</title>
<script>
//Fading colour menus script by Dan Essex
var colors=new Array()
colors[0]="#808080"
colors[1]="#FF0000"
colors[2]="#808080"
colors[3]="#FF0000"
var x=0
function fade() {
while (x<4){
button1.style.background=colors[x];
x++;
window.setTimeout("fade()", 500);
}
}
</script>
</head>
<body bgcolor="#000000">
<table border="1" width="100%" height="48">
<tr>
<td name="button1" width="33%" height="42" onmouseover="fade()"><p align="center"><font
color="#FFFFFF" face="Arial" name="1"><big><big>Hello</big></big></font></td>
<td width="33%" height="42"></td>
<td width="34%" height="42"></td>
</tr>
</table>
</body>
</html>
The colours in the colorts array are just for testing and more will be added later. When i load the page and move the mouse over the button, I get the error message saying 'button1 is undefined or not an object'
Can anyone help, Please! I've been trying to get this 2 work for days! :(
<html>
<head>
<title>New Page 1</title>
<script>
//Fading colour menus script by Dan Essex
var colors=new Array()
colors[0]="#808080"
colors[1]="#FF0000"
colors[2]="#808080"
colors[3]="#FF0000"
var x=0
function fade() {
while (x<4){
button1.style.background=colors[x];
x++;
window.setTimeout("fade()", 500);
}
}
</script>
</head>
<body bgcolor="#000000">
<table border="1" width="100%" height="48">
<tr>
<td name="button1" width="33%" height="42" onmouseover="fade()"><p align="center"><font
color="#FFFFFF" face="Arial" name="1"><big><big>Hello</big></big></font></td>
<td width="33%" height="42"></td>
<td width="34%" height="42"></td>
</tr>
</table>
</body>
</html>
The colours in the colorts array are just for testing and more will be added later. When i load the page and move the mouse over the button, I get the error message saying 'button1 is undefined or not an object'
Can anyone help, Please! I've been trying to get this 2 work for days! :(