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

element-measurer

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

element-measurer

The javascript class for measure size of DOM.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-76.92%
Maintainers
1
Weekly downloads
 
Created
Source

ElementMeasurer

The javascript class for measure size of Element.

Install

$ npm install element-measurer

Usage

import ElementMeasurer from 'element-measurer';

// Measurement of Element.
// target: Element | 'selector' | document | window
const targetSize = new ElementMeasurer('#target');
let max = targetSize.maxScrollTop; // get maxScrollTop.

// Measurement of Document.
const docSize = new ElementMeasurer(document);
docSize.scrollTop = 200; // set scrollTop.

API

Image: element-and-client

Properties

  • clientWidth: ReadOnly Returns inner width of an element in pixels.
  • clientHeight: ReadOnly Returns inner height of an element in pixels.
  • scrollTop: Gets or sets of pixels that an element's content is scrolled vertically.
  • scrollLeft: Gets or sets the number of pixels that an element's content is scrolled to the left.
  • scrollWidth: ReadOnly Returns the width of the entire content of an element.
  • scrollHeight: ReadOnly Returns the height of the entire content of an element.
  • maxScrollTop: ReadOnly Returns maximum top scroll offset possible for the element.
  • maxScrollLeft: ReadOnly Returns maximum left scroll offset possible for the element.

License

MIT License

Keywords

FAQs

Package last updated on 12 Dec 2017

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