outerwidth

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i outerwidth

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • scottcorgan