---
title: "Problem med IE"
type: "forum-thread"
url: "https://www.webforum.nu/amne/javascript/83407-problem-med-ie"
topic: "JavaScript"
topic_url: "https://www.webforum.nu/amne/javascript"
author: "Cactuz"
published: "2003-08-03T23:49:57.000Z"
updated: "2003-08-03T23:58:27.000Z"
replies: 1
views: 147
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/javascript/83407-problem-med-ie"
---

# Problem med IE

## #1 — Cactuz, 2003-08-03T23:49Z

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';
	}	
}
```

Permalänk: https://www.webforum.nu/p/83407

## #2 — Cactuz, 2003-08-03T23:58Z

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

Permalänk: https://www.webforum.nu/p/1129234

---

Tråden på webben: https://www.webforum.nu/amne/javascript/83407-problem-med-ie
