LarrySteele
Programmer
Corporate intranet site where IE8 is the standard browser.
We had been using gifs for our buttons - site color for active and gray when inactive. Easy day.
I'm in the process of internationalizing the site to translate labels, tool tips, instructions, etc to any one of 15 languages.
Rather than having 30 images for each button, I'm switching them to html inputs and having CSS manage their appearance. The I'll just fill in the text dynamically. Works great, easy day, except... When I change the className of one of these buttons, the color does not change until the mouse hovers over it.
Here's my javascript snippet that should change the button's className from button_dis to button. After this runs, my button's background should change to the site's active color. Since I didn't see the change, I added an alert to confirm the script was running and that the className was button. The alert test passed, yet the button's background color did not change. Also, the var "d" correctly evaluates true.
I found that if I mouse over the button, it does change to the active color I set for button:hover pseudo class. That tells me that the correct class was set and attached to the button. When I move my mouse away from the button, then the correct active background color appears.
Of course in FF 14, the color changes right away.
I've seen several posts that mention a bug in IE8's rendering during my search, but the descriptions didn't appear to related to what I'm seeing. Though it does seem to be a rendering issue. I'm sure I'm not the only to experience this, but I wasn't able to figure out the right question for Google to get the answer I need.
Is this a bug in IE8 that needs to be worked around or am I missing something painfully simplistic.
Thanks in advance.
We had been using gifs for our buttons - site color for active and gray when inactive. Easy day.
I'm in the process of internationalizing the site to translate labels, tool tips, instructions, etc to any one of 15 languages.
Rather than having 30 images for each button, I'm switching them to html inputs and having CSS manage their appearance. The I'll just fill in the text dynamically. Works great, easy day, except... When I change the className of one of these buttons, the color does not change until the mouse hovers over it.
Here's my javascript snippet that should change the button's className from button_dis to button. After this runs, my button's background should change to the site's active color. Since I didn't see the change, I added an alert to confirm the script was running and that the className was button. The alert test passed, yet the button's background color did not change. Also, the var "d" correctly evaluates true.
Code:
if(d) {
document.getElementById("btn_reset").className = "button";
} else {
document.getElementById("btn_reset").className = "button_dis";
}
alert(document.getElementById("btn_reset").className);
I found that if I mouse over the button, it does change to the active color I set for button:hover pseudo class. That tells me that the correct class was set and attached to the button. When I move my mouse away from the button, then the correct active background color appears.
Of course in FF 14, the color changes right away.
I've seen several posts that mention a bug in IE8's rendering during my search, but the descriptions didn't appear to related to what I'm seeing. Though it does seem to be a rendering issue. I'm sure I'm not the only to experience this, but I wasn't able to figure out the right question for Google to get the answer I need.
Is this a bug in IE8 that needs to be worked around or am I missing something painfully simplistic.
Thanks in advance.