js常见的兼容性问题
取行外样式的值
我们都知道通过js 的style 不能行外样式 ,当我们想要获取行外样式时一般需要用下面的两个方法;
1 IE 的取值方法;currentStyle
2 Chrome 的方法 getComputedStyle(oDiv,false)
他们的兼容写法
function getStyle(domObj, attr) {
if(window.getComputedStyle) {
/...
原创
2019-05-18 14:24:17 ·
453 阅读 ·
0 评论