Leo

一个获取非行间样式的函数

字数统计: 34阅读时长: 1 min
2015/03/27 Share
1
2
3
4
5
6
7
8
9
10
11
12
function getStyle(obj,attr,value){

if(!value){
if (obj.currentStyle){
return obj.currentStyle(attr);
}else{
obj.getComputedStyle(attr,false);
}
}else{
obj.style[attr] = value;
}
}