获取属性 function getStyle(element,type){ return window.getComputedStyle(element,null).getPropertyValue(type); } 对应的代码 https://github.com/hejiahao/HTML-front