為什么使用火狐瀏覽器使用getComputedStyle會(huì)報(bào)錯(cuò),錯(cuò)誤為 obj.getComputedStyle is not a function。求大神們解答
function getStyle(obj,attr){
????if(obj.currentStyle){
????????return obj.currentStyle[attr];
????}else{
????????return obj.getComputedStyle(obj,false)[attr];
????}
}
2017-04-25
else{
return window.getComputedStyle(obj,false)[attr]
}
2016-03-04
function getStyle(obj,attr){
????if(obj.currentStyle){
????????return obj.currentStyle[attr];
????}else{
????????return getComputedStyle(obj,false)[attr];
????}
}
2016-03-04
是getComputeStyle,拼寫(xiě)錯(cuò)誤