时间:2021-07-01 10:21:17 帮助过:29人阅读
DOM.style只能读到写在html中的样式值
获取样式值的函数
function returnStyle(obj,styleName){var myObj = typeof obj =="string" ? document.getElementById(obj) : obj;if(document.all){return eval("myObj.currentStyle."+ styleName);} else {returneval("document.defaultView.getComputedStyle(myObj,null)." +styleName);}}