Jump to content

Recommended Posts

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.