通用于ie和firefox的函数GetCurrentStyle(obj,prop)_javascript技巧
来源:动视网
责编:小采
时间:2020-11-27 20:34:16
通用于ie和firefox的函数GetCurrentStyle(obj,prop)_javascript技巧
通用于ie和firefox的函数GetCurrentStyle(obj,prop)_javascript技巧:function GetCurrentStyle (obj, prop) { if (obj.currentStyle) { return obj.currentStyle[prop]; } else if (window.getComputedStyle) { prop = prop.replace (/([A-Z])/g, -$1); prop = prop.toLowerCase (); return window.getComputedStyle (obj,
导读通用于ie和firefox的函数GetCurrentStyle(obj,prop)_javascript技巧:function GetCurrentStyle (obj, prop) { if (obj.currentStyle) { return obj.currentStyle[prop]; } else if (window.getComputedStyle) { prop = prop.replace (/([A-Z])/g, -$1); prop = prop.toLowerCase (); return window.getComputedStyle (obj,

function GetCurrentStyle (obj, prop) {
if (obj.currentStyle) {
return obj.currentStyle[prop];
}
else if (window.getComputedStyle) {
prop = prop.replace (/([A-Z])/g, "-$1");
prop = prop.toLowerCase ();
return window.getComputedStyle (obj, "").getPropertyValue(prop);
}
return null;
}
代码来自于http://tvweek.com/javascripts/default.js
通用于ie和firefox的函数GetCurrentStyle(obj,prop)_javascript技巧
通用于ie和firefox的函数GetCurrentStyle(obj,prop)_javascript技巧:function GetCurrentStyle (obj, prop) { if (obj.currentStyle) { return obj.currentStyle[prop]; } else if (window.getComputedStyle) { prop = prop.replace (/([A-Z])/g, -$1); prop = prop.toLowerCase (); return window.getComputedStyle (obj,