现在的位置: 首页 > 综合 > 正文

获得指定元素的css样式方法

2013年08月03日 ⁄ 综合 ⁄ 共 136字 ⁄ 字号 评论关闭
function getCss(ele,attr){
	if(window.getComputedStyle){
		return window.getComputedStyle(ele,null)[attr];
	}else{
		return ele.currentStyle[attr];	
	}
}

抱歉!评论已关闭.