/** * 獲取屬性函數(兼容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]; } }