//兼容方法获取元素样式function getStyle(ele,attr){ if(window.getComputedStyle){ return window.getComputedStyle(ele,null)[attr]; } return ele.currentStyle[attr];}
Javascript 兼容方法获取元素样式
原文:http://www.cnblogs.com/powerplay/p/7746923.html