computedStyle
Cross-browser currentStyle/getComputedStyle implementation
Getting Started
Download one of the available flavors:
- Production version
- Development version - Available via
bower install computedStyle
- CommonJS version - Available via
npm install computed-style
andcomponent install twolfson/computedStyle
- AMD version
In your web page:
Documentation
computedStyle
is a single purpose function
;/** * Cross-browser getComputedStyle * @param * @param * @returns Property from the browser * * @note These properties can vary from browser to browser. * For example, IE6 will return #FF0000 whereas Firefox will return rgb(255, 0, 0) * I have chosen to avoid this for this repo as it exits the single purpose * and jQuery follows the same approach. */
Examples
// Grab the z-index of an element; // Grab the background-color of an element;
Donating
Support this project and others by twolfson via gratipay.
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint your code using npm run lint
and test via npm test
.
License
Copyright (c) 2013 Todd Wolfson
Licensed under the MIT license.