Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@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

Some useful tool of browser scroll, such as tool for calculating position relative to page/client, tool for getting the native scrollbar width...

  • 3.4.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
685
decreased by-6.8%
Maintainers
1
Weekly downloads
 
Created
Source

@livelybone/scroll-get

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

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, 
  getNativeScrollbarWidth
} from '@livleybone/scroll-get'

/**
 * @result DOMRect | ClientRect | TextRectangle
 * */
var rect = getRect(document.getElementById('id'))
/**
 * @result { pageLeft: Number, pageTop: Number }
 * */
var pos = posRelativeToPage(document.getElementById('id'))
/**
 * @result { clientLeft: Number, clientTop: Number }
 * */
var pos1 = posRelativeToClient(document.getElementById('id'))
/**
 * @result { x: Number, y: Number }
 * */
var scrollbarInfo = getNativeScrollbarWidth()

Keywords

FAQs

Package last updated on 28 Jul 2019

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