1.0.1 • Published 4 years ago
el-operation v1.0.1
获取元素到 顶部 与 左侧 的距离
Including
<script src="./dist/el-operation.js"></script>
Usage
let box = document.querySelector('.box')
box.getTop() //元素到左侧距离
box.getLeft() //元素到顶部距离
API
Element.prototype.getLeft()
- 元素到左侧距离
Element.prototype.getTop()
- 元素到顶部距离
1.0.1
4 years ago