ShoeLace1291 Posted December 18, 2007 Share Posted December 18, 2007 I'm making a calander and I want a cell to change colors every time a user hovers over it. I'm trying to echo an onmouseover thing but I can't get the syntax right. echo ' onmouseover="this.className='hover'">$counter</td>\n'; Anyone have any ideas? Quote Link to comment Share on other sites More sharing options...
trq Posted December 18, 2007 Share Posted December 18, 2007 <?php echo " onmouseover='this.className=\"hover\"'>$counter</td>\n"; ?> Quote Link to comment Share on other sites More sharing options...
Lamez Posted December 18, 2007 Share Posted December 18, 2007 print 'onmouseover="this.className='hover'">$counter</td>\n'; or print <<<JS onmouseover="this.className='hover'">$counter</td> JS; do not forget your <?php ?> Quote Link to comment Share on other sites More sharing options...
nafetski Posted December 18, 2007 Share Posted December 18, 2007 You can also use CSS to achieve this..might like it better than java! Just set the hover state. The other ways work just as well tho =) Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted December 18, 2007 Share Posted December 18, 2007 You can also use CSS to achieve this..might like it better than java! Just set the hover state. The other ways work just as well tho =) I don't think IE supports that... I think they only support hover on links. Quote Link to comment Share on other sites More sharing options...
lemmin Posted December 18, 2007 Share Posted December 18, 2007 You are right, Little Guy, what's stupid is that the MS's html documentation shows that it DOES work on many tags that it doesn't. If you click styles on the td tag it shows hover there: http://msdn2.microsoft.com/en-us/library/ms535903.aspx Anyway, you might want to make sure that you are echoing that in the right place <td <?php echo " onmouseover=\"this.className='hover'\">$counter</td>\n"; ?> Same as thorpe's, but I have always used mini quotes on the inside, it probably works both ways, though. 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.