<script>
getStyle(ele,attr);
function getStyle(ele,attr){
if(window.getComputedStyle){
return window.getComputedStyle(ele,false)[attr];
}else{
//兼容IE
return ele.currentStyle[attr];
}
}
</script>
<script>
getStyle(ele,attr);
function getStyle(ele,attr){
if(window.getComputedStyle){
return window.getComputedStyle(ele,false)[attr];
}else{
//兼容IE
return ele.currentStyle[attr];
}
}
</script>
本文标题:获取css中的属性值
本文链接:https://www.haomeiwen.com/subject/xkzscxtx.html
网友评论