javascript脚本化CSS系列和封装兼容方法的getSty

2017-11-08  本文已影响12人  刘翾

脚本化CSS

读写元素

查询计算样式

查询样式

封装兼容方法getStyle(obj, prop);

function getStyle(elem, prop,fakeNode) {
    if(window.getComputedStyle){
        return window.getComputedStyle(elem, fakeNode)[prop];
    }else{//低版本IE
        return elem.currentStyle[prop];
    }
}

学到这里的朋友们就可以自己尝试去做一个轮播图了, 下面附上我自己做的轮播图代码链接, http://blog.csdn.net/c_kite/article/details/53190653

上一篇 下一篇

猜你喜欢

热点阅读