This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getOffset = (event) -> | |
| target = event.target | |
| # 计算当前触发元素到文档的距离 | |
| pageCoord = | |
| X: 0 | |
| Y: 0 | |
| # 计算从当前触发元素到根节点为止, | |
| # 各级 offsetParent 元素的 offsetLeft 或 offsetTop 值之和 |