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

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

获取对象的属性值。

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

function getConputedStyle(elm){

  if(windows.getComputedStyle)        

    return windows.getComputedStyle(elm);   

  return elm.currentStyle;}

posted @ 2015-10-28 19:34  /null  阅读(398)  评论(0)    收藏  举报