therschbach Posted March 12, 2009 Share Posted March 12, 2009 I have a js rollover set up for a <td> to change the background color and the text color, but neither is happening. Now, this <table> is already part of a rollover...it is set to visibility:visible onMouseOver the container div. I'm not sure if this is causing a conflict. The <td> is the first one with the onMouseOver & onMouseOut. Any ideas?HTML: <div id="authorfield" onMouseOver="reveal('author')" onMouseOut="hide('author')"> <img id="author" src="pictures/button2.jpg" alt="Author"> <div id="authormenu"> <table id="authortable"> <tr> <td onMouseOver="menuButtonOn" onMouseOut="menuButtonOff" ><a id="about" onClick="ajaxFunction(this.id)">About Me</a></td> </tr> <tr> <td><a id="findstodate" onClick="ajaxFunction(this.id)">Finds</a></td> </tr> <tr> <td><a id="equipment" onClick="ajaxFunction(this.id)">Equipment</a></td> </tr> </table> </div></div> java script: function reveal(buttonID){document.getElementById(buttonID+"menu").style.visibility = "visible"; }function hide(buttonID){document.getElementById(buttonID+"menu").style.visibility = "hidden"; }function menuButtonOn(){this.style.background = "#e2cda1";this.style.color = "white";}function menuButtonOff(){this.style.background = "#674d3d";this.style.color = "black";} Link to comment Share on other sites More sharing options...
jesh Posted March 12, 2009 Share Posted March 12, 2009 Change your HTML to: <td onmouseover="menuButtonOn(this);" onmouseout="menuButtonOff(this);"> And your javascript to: function menuButtonOn(el){el.style.background = "#e2cda1";el.style.color = "white";}function menuButtonOff(el){el.style.background = "#674d3d";el.style.color = "black";} Link to comment Share on other sites More sharing options...
jeffman Posted March 12, 2009 Share Posted March 12, 2009 never mind Link to comment Share on other sites More sharing options...
jesh Posted March 12, 2009 Share Posted March 12, 2009 never mindWithin the same minute even! Link to comment Share on other sites More sharing options...
therschbach Posted March 12, 2009 Author Share Posted March 12, 2009 Holy crap it works. That was a quicky. Thanks m8! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.