...

View Full Version : tr onmouseover class change



homerUK
06-26-2004, 02:18 PM
I have this code

<tr onmouseover="this.className='foo'">

but it doesnt do anything!!!!!

any ideas?!

homerUK
06-26-2004, 02:45 PM
further more, when a class is associated with a <TD>, I cannot change it!?

here's the HTML

<tr onmouseover="this.className='foo'">
<td class="columnone">&nbsp;</td>
<td class="columntwo">&nbsp;</td>
</tr>

and the CSS

.foo { background-color:red; }
.columnone { background-color:#CCCCCC; }
.columntwo { background-color:#BBBBBB; }

so basically because the TDs have been assigned a class - when I say to the mouseover, it doesnt do anything. If I actually remove the classes from the <TD>'s - it works..... how can I do this?!

neofibril
06-26-2004, 03:42 PM
If you don't want the tr class to be overridden by the td classes, don't assign td classes, or remove them.

- onmouseover="classStuff(this)" -

function classStuff(blah)
{
// set blah.className...
var tds = blah.getElementsByTagName("TD");
// loop tds, change classNames to ""...
}

Vladdy
06-26-2004, 04:05 PM
www.vladdy.net/Demos/IEPseudoClassesFix.html

homerUK
06-28-2004, 09:58 AM
cheers for the help guys...


If you don't want the tr class to be overridden by the td classes, don't assign td classes, or remove them.


I need to assign the TD classes in the first instance to apply their own formatting.... might have to look for another way around it....

Vladdy - cheers for that link - seems to do what I want - so will give it a go...!

thanks again guys :thumbsup:

neofibril
06-28-2004, 11:34 AM
homerUK,

My apologies for the blunt reply...

homerUK
06-28-2004, 11:35 AM
homerUK,

My apologies for the blunt reply...

hey, no worries!!!! no need to apologise!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum