Sign in to follow this  
bioagentX

Javascript help

Recommended Posts

I'm creating a website for a friend at this site. Now as you can see the site is far from finished, but my attention is currently focused on the navigation bar on the left. I'm trying to make it so that the link color changes not when the cursor rolls over the link, but if the cursor rolls over anywhere in the entire table cell. Currently the table cell just changes to the color orange, but I want the link color text inside of it to change to yellow. I'd really appreciate it if someone could tell me how I would go about doing this, I've been going at it for like 2 hrs now. Any help is appreciated, --BioX

Share this post


Link to post
Share on other sites
Surround your text with named span elements and then change 'document.<itemname>.style'

You could accomplish what you're trying to acheive a lot more easily by using CSS and implementing the :hover method in the style.

eg:

#menuitem { background-color: #fff; color: #000; }
#menuitem:hover { background-color: #000; color: #fff; }

Then with in your table element <td class="menuitem">My text</td>


I do this on my site with not a ling of javascript.

Share this post


Link to post
Share on other sites
That doesn't seem to work. Are you sure you told me what I needed to know? In general can you use style sheets to make default event handlers (i.e something like mystyle:onMouseOver{color: red;})?


--BioX

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this