@livelybone/scroll-get
pkg.module supported
, which means that you can apply tree-shaking in you project
A module for get left/top distance of element, or get scrollLeft/scrollTop of document
repository
https://github.com/livelybone/scroll-get.git
Demo
https://github.com/livelybone/scroll-get#readme
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'))
import * as ScrollGet from '@livleybone/scroll-get'
const {getRect, posRelativeToPage, posRelativeToClient} = ScrollGet