繁体   English   中英

getComputedstyle - IE8问题

[英]getComputedstyle - IE8 issue

如何使此代码在IE8(以及可能的话)下工作?

   return parseInt(window.getComputedStyle(indicator).getPropertyValue('z-index'), 10);

将其添加到您的代码中:

if( !window.getComputedStyle) {
    window.getComputedStyle = function(e) {return e.currentStyle};
}

此外,您可以使用getComputedStyle(indicator).zIndex以跨浏览器方式获取属性。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM