PDA

View Full Version : JS & DHTML onMouseOver change text colour?


artslave
03-07-2002, 04:50 AM
I got my cascading menu working (previous thread in html (http://www.coderforums.net/showthread.php?s=&threadid=80)) and now I'm trying to spice it up a bit. As you can see from the link provided below my menu is basic black and white, when the cursor hovers over the table cell it changes from white to red. The text stays black until the cursor is moved over it and then it turns white (CSS).

What I would like to happen is the text to turn white even when the cursor is only on the table cell portion.

**update**
I've been playing around with JavaScript and dhtml. I've gotten the white text onMouseOver to work but I need help cleaning up my JavaScript. The link below will open a window with 2 primary menu selections. The first has the dropdown as described in the first paragraph. The second menu selection keeps my text white during the MouseOver but as you will see it works too well. The links in the submenu also go white which means they are unreadable since they are on a white background, unreadable until the cursor hovers over that selection to make the background red.

I'm convinced that the glitch is in my JS. I need the individual links to remain black until the cursor hovers in the corresponding table cell, then when the cell turns red the text changes to white.

Thanks,

Link: http://members.shaw.ca/artslave/dhtml/ddmenu2.html

Here's my colour change JS:
<script type="text/javascript">
function newColor(color)
{
colour1.style.color=color;

colour2.style.color=color;

colour3.style.color=color;

colour4.style.color=color;

colour5.style.color=color;

colour6.style.color=color;
}
</script>

artslave
03-09-2002, 08:45 PM
I feel this deserves a bump now that we're on the new server :D

Still looking for help on this one.

Dan203
04-01-2002, 11:26 PM
Are you really set on writing it yourself? If not then check out this script...

http://www.webreference.com/dhtml/column64/

Dan

artslave
04-02-2002, 02:14 AM
Thanks Dan I appreciate the advice.

I ended up going with one by OpenCube called QuickMenu
http://www.opencube.com/effect_dqm.html

It looks like it will work for now but may have some glitches when running IE on MacOS. When I have more time to play with it I'm going to give FireWorks and this tutorial a try (http://www.spoono.com/tutorials/fireworks/popupmenu/).