1.0.0 • Published 8 years ago

get-dimensions v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

get-dimensions

npm

Get the dimensions of a DOM element.

npm install get-dimensions

##Usage example

var getDimensions = require("get-dimensions");

var element = document.getElementById("container");
var dimensions = getDimensions(element);

Dimensions will be an object with the following keys, allowing you to get the width and height with or without margins:

  • width
  • height
  • outerWidth
  • outerHeight