ali_2kool2002 Posted March 29, 2007 Share Posted March 29, 2007 Hi im not sure how to change this line of code in html so that i can use it for my tables to change color when a user puts their mouse curser on. This code below works in html but when iv tried to use it in php but doesnt work...? can someone help me convert the html to pho HTML CODE WORKIN IN <TD> TAG <td>onMouseover="this.bgColor='lightgrey'" onMouseout="this.bgColor='#FFFFFF'"</td> I need to somehow use the above to work on this PHP line below which has a variable in the table <td align="center">' . $results['driver_status'] . '</td> Thanks for anyone who can crack it in php thanks!! Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted March 29, 2007 Share Posted March 29, 2007 You have to escape the single quotes in your html when you are echoing them in a php statement enclosed in single quotes.... echo '<td onMouseover="this.bgColor=\'lightgrey\'" onMouseout="this.bgColor=\'#FFFFFF\'">' . $results['driver_status'] . '</td> Quote Link to comment Share on other sites More sharing options...
monk.e.boy Posted March 29, 2007 Share Posted March 29, 2007 I think you change the background-color using CSS :hover? True? monk.e.boy Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted March 29, 2007 Share Posted March 29, 2007 The css ":hover" pseudo class will not work in IE except on anchor tags. Quote Link to comment Share on other sites More sharing options...
ali_2kool2002 Posted March 29, 2007 Author Share Posted March 29, 2007 hit mans worked !! cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.