Dynamically Changing Classes
Internet Explorer doesn't notice a fucking thing.
Say I have the following:
Well, I suppose it does notice the class change - if I call (the element in question).getAttribute('class') it returns the correct value. I just completely fucking ignores all styles associated with that class.
I've tried a number of "cheats" to try tricking Internet Explorer into doing the useful thing:
So thanks to Internet Explorer, I now get to get several blocks of "IE blows fucking chunks and I have to write this load of JavaScript when a single class swap should do the trick" instead of moving on to something else to get this project done.
Say I have the following:
<div class="thin">stuff</div>and I want to using unintrusive JavaScript to change it to this:
<div class="wide">stuff</div>I would hope that would work fine, like it does for every other browser, but Internet Explorer simply ignores it.
Well, I suppose it does notice the class change - if I call (the element in question).getAttribute('class') it returns the correct value. I just completely fucking ignores all styles associated with that class.
I've tried a number of "cheats" to try tricking Internet Explorer into doing the useful thing:
- (the element in question).innerHTML = '' + (the element in question).innerHTML
- re-setting the stylesheet in question
- even looping through the stylesheets, disabling them and then enabling them after a short timeout to make sure they turn off in the first place
So thanks to Internet Explorer, I now get to get several blocks of "IE blows fucking chunks and I have to write this load of JavaScript when a single class swap should do the trick" instead of moving on to something else to get this project done.
Labels: ie sucks, internet explorer