放飞自我 LET DREAMS FLY

[f]获得非行间样式方法

function getStyle(obj, attr)
{
    if(obj.currentStyle)
    {
        return obj.currentStyle[attr];
    }
    else
    {
        return getComputedStyle(obj, false)[attr];
    }
}
getStyle(oDiv, 'width');

posted on 2012-10-23 16:47  niuben  阅读(119)  评论(0)    收藏  举报

导航