offset-in-viewport
Get offset of a dom element in the viewport
Last updated 7 years ago by shtylman .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install offset-in-viewport 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.0.1                                ...           latest (7 years ago)

1 Versions

  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |