Javascript - changing CSS classes - won't work in IE
Posted: Thu Jul 20, 2006 7:14 am
Stupid IE once again
Or maybe it's me
The problem is like this - I'm using JavaScript to change the classes of DIV. In Firefox everything works fine but IE seems to "see" only the first of the generated classes.
Strange thing in IE is that only changing of the first class works as it should.
Any idea where is the problem solution?

Or maybe it's me
The problem is like this - I'm using JavaScript to change the classes of DIV. In Firefox everything works fine but IE seems to "see" only the first of the generated classes.
Code: Select all
<style type='text/css'>
div#mapcz_top.range1 {background-color: red; background-position: 175px 107px;}
div#mapcz_top.range17 {background-color: red; background-position: 176px 108px;}
div#mapcz_top.range4 {background-color: red; background-position: 172px 102px;}
[...]
</style>Code: Select all
<a href='#' onmouseover='document.getElementById("mapcz_top").className = "range1"'
onmouseout='document.getElementById("mapcz_top").className = "nospot"'>AVIM Praha</a><br />
<a href='#' onmouseover='document.getElementById("mapcz_top").className = "range17"'
onmouseout='document.getElementById("mapcz_top").className = "nospot"'>Kapslovna</a><br />
<a href='#' onmouseover='document.getElementById("mapcz_top").className = "range4"'
onmouseout='document.getElementById("mapcz_top").className = "nospot"'>Magnum Praha</a><br />
[...]Any idea where is the problem solution?