webForumDet fria alternativet

Problem med IE

1 svar · 147 visningar · startad av Cactuz

CactuzMedlem sedan okt. 2001635 inlägg
#1

Den här koden funkar i Mozilla Firebird.
Men det buggar i IE. Cellen får #C0C0C0 färgen men sen när den ska byta tillbaka (onmouseout) vill den inte.

<td class="'.$bg.'" OnClick="fadeclick(this, \''.$bg.'\')" OnMouseOver="fade(this, \''.$bg.'\')" OnMouseOut="fade(this, \''.$bg.'\')">
function fade(obj, cl)
{
	if(obj.style.backgroundColor != 'rgb(170, 201, 235)')
	{
	if(obj.style.backgroundColor == 'rgb(192, 192, 192)')
	{
		if(cl == 'puncon1')
		{
			obj.style.backgroundColor='#DEDFDF';
		}else{
			obj.style.backgroundColor='#EEEEEE';
		}
	}else{
		obj.style.backgroundColor = '#C0C0C0';
	}
	}	
}
function fadeclick(obj, cl)
{
	if(obj.style.backgroundColor == 'rgb(170, 201, 235)')
	{
		obj.style.backgroundColor='#C0C0C0';
	}else{
		obj.style.backgroundColor = '#AAC9EB';
	}	
}
CactuzMedlem sedan okt. 2001635 inlägg
#2

Problemet var att obj.style.backgroundColor i IE stod i HEX.

Genererad på 372 ms · cache AV · v20260730165559-full.f96bc7eb