function getStyle(obj, style) {
if (window.getComputedStyle) {
//chrome, firefox, ie9以上版本浏览器的支持写法
return window.getComputedStyle(obj, null)[style];
} else {
//所有ie版本的支持写法, 但chrome和firefox不支持
return obj.currentStyle[style];
}
}