angelodev Posted May 7, 2007 Share Posted May 7, 2007 Hi there, i designed a table as follow: table.calendar { width: 160px; height: 150px; table-layout: fixed; text-align: center; border-collapse: separate; border-spacing: 1px; border-color: #000000; border-width: 1px; border-style: solid; empty-cells: hide; background: #CCFFFF; } td.caption { font-weight: bold; } td.empty { background: #FFFFFF; } td.today { background: #FFFF99; } td.selected { background: red; } the selected section is activated with the javascript onMouseOver event. The onMouseOut restore the original CSS section. I'm in trouble with the today section (the table is a calendar). initially it's correctly colored and also the onMouseOver event works well, but when the onMouseOut occurs the background doesn't come back to the correct setion and the cell take the general setting of the table, no more td.today. Here the is the Javascript Code if (($startdate == date("j")) && ($month == date("n")) && ($year = date("Y"))){ ?><TD class="today" onmouseover = "this.className = 'selected';" onmouseout = "this.className = 'today;'"><?php echo (date("j")); ?></Td><?php } else { ?><TD class="notoday" onmouseover = "this.className = 'selected';" onmouseout = "this.className = ' notoday;'"><?php echo ($startdate); ?></Td><?php Thank in advice for your gold help!!! Link to comment https://forums.phpfreaks.com/topic/50403-cell-background-become-crazzy/ Share on other sites More sharing options...
mainewoods Posted May 8, 2007 Share Posted May 8, 2007 ?><TD class="today" onmouseover = "this.className = 'selected';" onmouseout = "this.className = 'today;'"><?php echo (date("j")); ?></Td><?php you have a semicolon after the second "today" but before the closing single quote Link to comment https://forums.phpfreaks.com/topic/50403-cell-background-become-crazzy/#findComment-247781 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.