码迷,mamicode.com
首页 > 其他好文 > 详细

函数语法:currentStyle、getComputedStyle兼容判断

时间:2019-01-07 21:20:32      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:computed   width   odi   element   span   size   ntb   tco   nts   

 

var oDiv = document.getElementById(aa);
if(oDiv.currentStyle){
      var style = oDiv.currentStyle;
     alert(‘ie:‘+style.width)

} else if(window.getComputedStyle) {
      var style = window.getComputedStyle(oDiv);
      alert(‘谷歌:‘+style.width)
}

 

函数语法:currentStyle、getComputedStyle兼容判断

标签:computed   width   odi   element   span   size   ntb   tco   nts   

原文地址:https://www.cnblogs.com/liubingyjui/p/10234811.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!