javascript獲取非行間樣式的函數封裝

/**
 * 獲取屬性函數(兼容IE)
 * @param {Object} box
 * @param {Object} attribut
 */
function getStyle(box,attribut){
	if(box.currentStyle){//IE瀏覽器
		return box.currentStyle[attribut];
	}
	else{//其餘瀏覽器
		return getComputedStyle(box,false)[attribut];
	}
}
相關文章
相關標籤/搜索