在IE里用 obj.currentStyle.paddingTop
在非IE里用:
if("undefined"!=typeof HTMLElement)
{
HTMLElement.prototype.getCssValue=function(prop)
{
if(!window.getComputedStyle) return null;
prop=prop.replace(/([A-Z])/g, "-$1").toLowerCase();
return window.getComputedStyle(this, "").getPropertyValue(prop);
};
}
obj.getCssValue("paddingTop");
在非IE里用:
if("undefined"!=typeof HTMLElement)
{
HTMLElement.prototype.getCssValue=function(prop)
{
if(!window.getComputedStyle) return null;
prop=prop.replace(/([A-Z])/g, "-$1").toLowerCase();
return window.getComputedStyle(this, "").getPropertyValue(prop);
};
}
obj.getCssValue("paddingTop");
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货