Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-30-2002, 12:11 AM   PM User | #1
juh915
Registered User

 
Join Date: Jul 2002
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
juh915 is an unknown quantity at this point
changing background colors of a <td>

Hi,
Can somebody help me with changing the background color of a table cell (<td>)? I'm not sure how to do it.

I would like to be able to rollover the table cell and have it change colors. I imagine that this would be possible using a onMouseOver. Is there any more JS required other than that single attribute?


thanks,
Justin
juh915 is offline   Reply With Quote
Old 07-30-2002, 12:46 AM   PM User | #2
boywonder
Regular Coder

 
Join Date: Jun 2002
Location: New York, USA
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
boywonder is an unknown quantity at this point
Sort of:
You can throw this into your td tag
onmouseover="this.style.backgroundColor='blue';"
(use the same with onmouseout to change it back)

However this won't work in NS4, you'll need to deal with layers to get the same effect. Search around http://www.javascriptkit.com . There was a tutorial there for exactly that. That is if your one of those people who still cares about NS4
hope that helps
boywonder is offline   Reply With Quote
Old 07-30-2002, 12:47 AM   PM User | #3
juh915
Registered User

 
Join Date: Jul 2002
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
juh915 is an unknown quantity at this point
hey thanks a lot!

now I have another problem...how do i get that table cell to be able to link to another page. So not only is the text in the cell a link, but rather the whole cell is a link.

i can't just put an href tag in the <td> tag can I?


thanks again,
justin

Last edited by juh915; 07-30-2002 at 12:58 AM..
juh915 is offline   Reply With Quote
Old 07-30-2002, 01:21 AM   PM User | #4
adios
Senior Coder

 
Join Date: Jun 2002
Posts: 1,404
Thanks: 2
Thanked 32 Times in 32 Posts
adios is on a distinguished road
<td style="cursor:hand;" onclick="window.location='URL'">
adios is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:48 PM.


Advertisement
Log in to turn off these ads.