為什么使用火狐瀏覽器使用getComputedStyle會報錯,錯誤為 obj.getComputedStyle is not a function。求大神們解答
function getStyle(obj,attr){
????if(obj.currentStyle){
????????return obj.currentStyle[attr];
????}else{
????????return obj.getComputedStyle(obj,false)[attr];
????}
}
function getStyle(obj,attr){
????if(obj.currentStyle){
????????return obj.currentStyle[attr];
????}else{
????????return obj.getComputedStyle(obj,false)[attr];
????}
}
2016-03-03
舉報
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,拼寫錯誤