page-ruler
v1.0.0
Published
A set of methods to measure the document, viewport and offset without jQuery.
Downloads
2
Maintainers
Readme
Page Ruler
Measure document, viewport and offset without jQuery.
Install
First install Page Ruler in your project root.
$ npm install --save page-ruler
Then include in your module using require().
var ruler = require('page-ruler');
Use
The following methods are available:
ruler.document(); // Returns { width, height } object
ruler.documentWidth();
ruler.documentHeight();
ruler.viewport(); // Returns { width, height } object
ruler.viewportWidth();
ruler.viewportHeight();
ruler.offset(); // Returns { top, left } object
ruler.offsetTop();
ruler.offsetLeft();