@reach/observe-rect
Observe the Rect of a DOM element.
Last updated 5 years ago by chancestrickland .
MIT · Repository · Original npm
$ cnpm install @reach/observe-rect 
SYNC missed versions from official npm registry.

Reach observeRect

Observe the rect of a DOM element.

Demo

Installation

npm install @reach/observe-rect
# or
yarn add @reach/observe-rect

Usage

import observeRect from "@reach/observe-rect";

let node = document.getElementById("some-node");

let rectObserver = observeRect(node, rect => {
  rect.left;
  rect.top;
  rect.height;
  rect.width;
});

About

A lot of things can change the position or size of an element, like scrolling, content reflows and user input. This utility observes and notifies you when your element's rect changes.

Legal

MIT License Copyright (c) 2018-present, Ryan Florence

Current Tags

  • 1.1.0                                ...           latest (5 years ago)

2 Versions

  • 1.2.0                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (14)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org