IEBlog : Site Compatibility and IE8

IEBlog : Site Compatibility and IE8

Here’re a couple of methods for coding to IE8 (new hacks! d’oh!):

Initial CSS Property Values

Unset properties on the currentStyle object now return their initial value. Relying on the old initial values for CSS properties such as z-index can cause problems. This is the root cause of issues with the ASP.NET menu control. SOLUTION: Perform a check for both the backwards compatible value and the standardized initial value.
var zIndex = elm.currentStyle.zIndex;
if(zIndex == 0) {
// custom code
}
var zIndex = elm.currentStyle.zIndex;
if(zIndex == 0 || zIndex == “auto”) {
// custom code
}