nashsaint Posted May 5, 2008 Share Posted May 5, 2008 Hi, I was able to display an sql query into tables with pagination. Now what I want to do is change the <tr> background color whenever I mouse hover on it. Many thanks. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 5, 2008 Share Posted May 5, 2008 <tr onmouseover="this.style.background='#FF0000';" onmouseout="this.style.background='';"> Quote Link to comment Share on other sites More sharing options...
JD* Posted May 5, 2008 Share Posted May 5, 2008 Also, via css: tr { background: white; } tr:hover { background: #FF0000; } Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 5, 2008 Share Posted May 5, 2008 Also, via css: tr { background: white; } tr:hover { background: #FF0000; } That won't work in IE6 though Quote Link to comment Share on other sites More sharing options...
Barand Posted May 5, 2008 Share Posted May 5, 2008 NOT PHP Quote Link to comment Share on other sites More sharing options...
JD* Posted May 5, 2008 Share Posted May 5, 2008 Sorry Barand, tried to work in some PHP stuff but it was mostly JS and CSS. Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted May 5, 2008 Share Posted May 5, 2008 <tr onmouseover="this.style.background='#FF0000';" onmouseout="this.style.background='';"> Do not use this. Use should steer away javascript at all costs. Your best bet is to use the tr:hover option listed above and don't support IE6. I'm sure the effect is not necessary but is only used for the sole purpose of "eye candy." Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 5, 2008 Share Posted May 5, 2008 <tr onmouseover="this.style.background='#FF0000';" onmouseout="this.style.background='';"> Do not use this. Use should steer away javascript at all costs. Your best bet is to use the tr:hover option listed above and don't support IE6. I'm sure the effect is not necessary but is only used for the sole purpose of "eye candy." TheFilmFod is right...I need to get out of the days of IE6 and move on to 7. Also, if you want to 'hack' IE6 to support :hover on all elements, check out: http://www.xs4all.nl/~peterned/csshover.html Quote Link to comment Share on other sites More sharing options...
nashsaint Posted May 7, 2008 Author Share Posted May 7, 2008 That was very helpful.. Thank you very much. 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.