var style=window.getComputedStyle(element[,pseudoElt]);

时间:2015-10-28 21:12:01   收藏:0   阅读:503

var style=window.getComputedStyle(element).property(属性);只读属性,不可修改(包括内联样式,以及以外的样式都可获取)IE9一下不支持

获取对象的属性值。

elm.currentStyle则支持所有的IE。兼容:

function getConputedStyle(elm){

  if(windows.getComputedStyle)        

    return windows.getComputedStyle(elm);   

  return elm.currentStyle;}

原文:http://www.cnblogs.com/nullObj/p/4918412.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!