原生JS代码封装(获取非行内样式===》兼容IE浏览器)
function getStyle(ele, prop) { if(ele.currentStyle) { //IE return ele.currentStyle[prop]; } else { //标准 return getComputedStyle(ele)[prop]; } }
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄

更多精彩