Socket
Socket
Sign inDemoInstall

@livelybone/scroll-get

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@livelybone/scroll-get

A module for get left/top distance to client or page of element


Version published
Weekly downloads
931
increased by25.81%
Maintainers
1
Weekly downloads
 
Created
Source

@livelybone/scroll-get

NPM Version Download Month gzip with dependencies: kb pkg.module

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'

/**
 * @result { DOMRect | ClientRect | TextRectangle }
 * */
var rect = getRect(document.getElementById('id'))
/**
 * @result { Object: {pageLeft:Number, pageTop:Number} }
 * */
var pos = posRelativeToPage(document.getElementById('id'))
/**
 * @result { Object: {clientLeft:Number, clientTop:Number} }
 * */
var pos1 = posRelativeToClient(document.getElementById('id'))
// when you want to set this module as external while you are developing another module, you should import it like this
import * as ScrollGet  from '@livleybone/scroll-get'
const {getRect, posRelativeToPage, posRelativeToClient} = ScrollGet

Keywords

FAQs

Package last updated on 25 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc