Link to home
Start Free TrialLog in
Avatar of jjfbuy
jjfbuy

asked on

Highlight table row onmouseover... revert back to original bgcolor?

I have a table consisting of rows of alternating colors.  On mouseover, I want the row to highlight in a third color.  On mouseout, I want it to just revert back to the original bgcolor.  

Right now, I'm using this function:

       <script language="JavaScript">
              function tdOver(obj) {
                        obj.style.background='yellow';
              }
       
              function tdOut(obj) {
                        obj.style.background='';
              }
       </script>


And my row looks like this:

       echo "<tr height=\"25\" valign=\"middle\" bgcolor=\"$row_color\" onmouseover=\"tdOver(this)\" onmouseout=\"tdOut(this)\">";


In FF, this works as expected, but in IE, it doesn't revert back to the original bgcolor, it fills the whole row white.  Does anyone know how I can get it to work the way I want it to in IE?  
ASKER CERTIFIED SOLUTION
Avatar of Basilisci
Basilisci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Zyloch
Zyloch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial