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. Link to comment https://forums.phpfreaks.com/topic/104228-change-background-color-when-mouse-hover/ 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='';"> Link to comment https://forums.phpfreaks.com/topic/104228-change-background-color-when-mouse-hover/#findComment-533592 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; } Link to comment https://forums.phpfreaks.com/topic/104228-change-background-color-when-mouse-hover/#findComment-533613 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 Link to comment https://forums.phpfreaks.com/topic/104228-change-background-color-when-mouse-hover/#findComment-533620 Share on other sites More sharing options...
Barand Posted May 5, 2008 Share Posted May 5, 2008 NOT PHP Link to comment https://forums.phpfreaks.com/topic/104228-change-background-color-when-mouse-hover/#findComment-533624 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. Link to comment https://forums.phpfreaks.com/topic/104228-change-background-color-when-mouse-hover/#findComment-533627 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." Link to comment https://forums.phpfreaks.com/topic/104228-change-background-color-when-mouse-hover/#findComment-533706 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 Link to comment https://forums.phpfreaks.com/topic/104228-change-background-color-when-mouse-hover/#findComment-533727 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. Link to comment https://forums.phpfreaks.com/topic/104228-change-background-color-when-mouse-hover/#findComment-535011 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.