@livelybone/scroll-get
pkg.module supported
, which means that you can apply tree-shaking in you project
A module for position relative to page or client
repository
https://github.com/livelybone/scroll-get.git
Demo
https://livelybone.github.io/tool/scroll-get
Installation
npm i -S @livelybone/scroll-get
Global name
ScrollGet
Usage
import {getRect, posRelativeToPage, posRelativeToClient} from '@livleybone/scroll-get'
var rect = getRect(document.getElementById('id'))
var pos = posRelativeToPage(document.getElementById('id'))
var pos1 = posRelativeToClient(document.getElementById('id'))