Danno13
12-21-2002, 02:34 PM
This is probably something really simple I'm missing out as I'm hardly a javascript expert but i'm having difficulties creating a script on my webpage.
Its a real simple script, I am designing a navigation menu and i want the background of each item on the menu to change color onmouseover. I've tried doing this in two ways:
1) using an onmouseover in the <td> tag of my menu table:
<td onmouseover="javascript:this.bgcolor=colors[0]>
colors is an array I have set within the head tags of my webpage, I have also tried putting in a color and hex value and still the background will not change color. This should be really simple i've used it before and if only i could get to a computer at colllege i could work it out!
2) I have used <span> tags and used a script to try and alter the background-color in style. When i do this i keep getting syntax errors where i use the '-' symbol in my script.
Can any give me any idea of where i'm goin wrong? This is driving me mad! If there is a better or easier way of doin this then I would be grateful for some ideas. I am using IE6 and ultimatley will be enhancing the script to include a color fade onmouseover but for now I'm just stuck with the simple begginings!
Any help will be greatly appreciated
Its a real simple script, I am designing a navigation menu and i want the background of each item on the menu to change color onmouseover. I've tried doing this in two ways:
1) using an onmouseover in the <td> tag of my menu table:
<td onmouseover="javascript:this.bgcolor=colors[0]>
colors is an array I have set within the head tags of my webpage, I have also tried putting in a color and hex value and still the background will not change color. This should be really simple i've used it before and if only i could get to a computer at colllege i could work it out!
2) I have used <span> tags and used a script to try and alter the background-color in style. When i do this i keep getting syntax errors where i use the '-' symbol in my script.
Can any give me any idea of where i'm goin wrong? This is driving me mad! If there is a better or easier way of doin this then I would be grateful for some ideas. I am using IE6 and ultimatley will be enhancing the script to include a color fade onmouseover but for now I'm just stuck with the simple begginings!
Any help will be greatly appreciated