欢迎来到博客园~~~

原生JS代码封装(获取非行内样式===》兼容IE浏览器)

 
function getStyle(ele, prop) {
    if(ele.currentStyle) { //IE
        return ele.currentStyle[prop];
    } else { //标准
        return getComputedStyle(ele)[prop];
    }
}
posted @ 2019-05-05 14:28  孙~洋  阅读(115)  评论(0)    收藏  举报