Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Font color on tablerow onMouseOver

Status
Not open for further replies.

shiggyshag

Programmer
Dec 14, 2001
227
GB
Hi

I have a a table (see Below) which on mouse over changes the Background Colour but how do I also change the font colour.

Any Ideas please

Cheers

<html>
<title>Hightlight Row</title>
<body bgcolor=&quot;#FFFFFF&quot;>
<table border=1 align=center>
<tr onMouseOver=&quot;this.bgColor = '#C0C0C0'&quot; onMouseOut =&quot;this.bgColor = '#FFFFFF'&quot; bgcolor=&quot;#FFFFFF&quot;>
<td align=right>1938</td>
<td align=right>Detroit</td>
<td align=right>.315</td>
<td align=right>556</td>
<td align=right>144</td>
<td align=right>175</td>
<td align=right>23</td>
<td align=right>4</td>
<td align=right>58</td>
<td align=right>146</td>
<td align=right>119</td>
<td align=right>92</td>
<td align=right>7</td>
</tr>
<tr onMouseOver=&quot;this.bgColor = '#C0C0C0'&quot; onMouseOut =&quot;this.bgColor = '#FFFFFF'&quot; bgcolor=&quot;#FFFFFF&quot;>
<td align=right>1939</td>
<td align=right>Detroit</td>
<td align=right>.312</td>
<td align=right>500</td>
<td align=right>112</td>
<td align=right>156</td>
<td align=right>42</td>
<td align=right>7</td>
<td align=right>33</td>
<td align=right>112</td>
<td align=right>91</td>
<td align=right>95</td>
<td align=right>8</td>
</tr>
</table>
 
<html>
<title>Hightlight Row</title>
<body bgcolor=&quot;#FFFFFF&quot;>
<table border=1 align=center>
<tr onMouseOver=&quot;this.bgColor = '#C0C0C0'; this.style.color='blue'&quot; onMouseOut =&quot;this.bgColor = '#FFFFFF'; this.style.color='black'&quot; bgcolor=&quot;#FFFFFF&quot;>
<td align=right>1938</td>
<td align=right>Detroit</td>
<td align=right>.315</td>
<td align=right>556</td>
<td align=right>144</td>
<td align=right>175</td>
<td align=right>23</td>
<td align=right>4</td>
<td align=right>58</td>
<td align=right>146</td>
<td align=right>119</td>
<td align=right>92</td>
<td align=right>7</td>
</tr> -----------------------------------------------------------------
&quot;The difference between 'involvement' and 'commitment' is like an eggs-and-ham breakfast: the chicken was 'involved' - the pig was 'committed'.&quot;
- unknown

mikewolf@tst-us.com
 
onMouseOver=&quot;this.style.backgroundColor = '#C0C0C0';this.style.color='#ff0000';&quot; onMouseOut =&quot;this.style.backgroundColor = '#FFFFFF';this.style.color='#000000';&quot;

(you need the 'style' bit in the scope there, which isn't in yr script) but if you start altering more than one style property you should really apply a different style --------------------------------

jb
 
Hi!
if you have many changes to do, create a table of style, 2 classes, and it will be done width this.className.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top