1.0.0 • Published 10 years ago

outerwidth v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
10 years ago

outerwidth

Get an element's outerwidth, including padding, borders, and margin. For use with Browserify.

Install

npm install outerwidth --save

Usage

var outerWidth = require('outerwidth');

var el = document.querySelector('.some-element');

el.style.width = '100px';
el.style.marginRight = '20px';
el.style.border = '1px solid #eee';

console.log(outerWidth(el)) // OUTPUTS: 122 - (width + marginRight + border)

Run Tests

Requires PhantomJS to be installed

npm install
npm test