Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Heirarchy issue, works in FF

0 views
Skip to first unread message

Earwig

unread,
May 28, 2006, 11:07:38 AM5/28/06
to
Hey all. I have a class specifying background color of a cell.
OnMouseOver, the background color of the object changes. OnMouseOut, I
would like it to change back to the class-defined style. By setting
.style.background = '' on the object, other browsers then sensibly defer
to the Class for background info. IE doesn't appear to.

Of course, I could make the code force the background color at the
object level, but I shouldn't have to, and it would mean putting colors
into the server-side code instead of the CSS. Yuck. How do I get IE to
lose the setting on an object and defer to the class?

Here's demonstration code. Try in FireFox and IE.

<HTML>
<HEAD>
<STYLE>
.rowclass {
background-color: #FF0000;
}
</STYLE>
</HEAD>
<BODY BGCOLOR="#00FF00">

<TABLE>
<TR CLASS="rowclass" ID="row"
ONMOUSEOVER="getElementById('row').style.background = '#FFFFFF';"
ONMOUSEOUT="getElementById('row').style.background = '';">
<TD>Some Text</TR>
</TABLE>

</BODY>
</HTML>

Mark ??;-)

unread,
Jun 7, 2006, 8:48:48 PM6/7/06
to
Try changing your Code to:
ONMOUSEOUT="getElementById('row').style.background = '#FF0000';">

Works on My IE 6 and FF.

-Mark

0 new messages