获取dom元素的属性
getStyleHeight(ele,property){ let elem = document.querySelector(ele) if(elem) { return document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(elem, false)[property] : elem.currentStyle[property]; } },
获取dom元素的属性,height ,left =》 height为170px
例如:
let substr = `#myHeight_${index}`
let offHeight = this.getStyleHeight(substr, 'height')
获取元素的高