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!!! Quote Link to comment 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 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.