Jump to content
  • Advertisement
Sign in to follow this  
bioagentX

Javascript help

This topic is 5072 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!