get-style-property
Gets the current value of a style property for a given DOM element.
Last updated 7 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install get-style-property 
SYNC missed versions from official npm registry.

get-style-property

Gets the current value of a style property for a given DOM element.

browser support

var foo              =  document.querySelector('.foo')
  , getStyleProperty =  require('get-style-property');

// assuming we applied css: ".foo { min-height: 20px }"

console.log(getStyleProperty(foo, 'min-height')); // => 20px

API

/**
 * Gets the current value of a style property for a given DOM element.
 *
 * @function
 * @param el {Object} The DOM element.
 * @param propName {String} The name of the property.
 * @return {String} The current value of the element's style and given property. 
 */
getStyleProperty(el, propName)

Current Tags

  • 0.1.1                                ...           latest (7 years ago)

2 Versions

  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 4
Last Day 0
Last Week 2
Last Month 3
Dependencies (0)
None
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |