offset-in-viewport

0.0.1 • Public • Published

offset

Get offset of a dom element within the viewport.

Installation

$ component install timoxley/offset

API

offset(el)

Get offset of an element within the viewport.

Example:

var offset = require('offset')
var target = document.getElementById('target')
console.log(offset(target))
// => {top: 69, left: 108}

Credit

Code adapted from jQuery.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    6

Package Sidebar

Install

npm i offset-in-viewport

Weekly Downloads

6

Version

0.0.1

License

none

Last publish

Collaborators

  • defunctzombie