function getStyle(el,cssProp){
if(el.currentStyle){ // ie
return el.currentStyle[sccProp];
}
else if(window.getComputedStyle){
return window.getComputedStyle(el)[sccProp];
}
//
return el.style[cssProp];
}
转载于:https://my.oschina.net/bosscheng/blog/517676