Custom Native to allow all of its methods to be used with any DOM element via the dollar function $.
Sets a CSS property to the Element.
myElement.setStyle(property, value);
//Both lines have the same effect. $('myElement').setStyle('width', '300px'); //The width is now 300px. $('myElement').setStyle('width', 300); //The width is now 300px.
Returns the style of the Element given the property passed in.
var style = myElement.getStyle(property);
$('myElement').getStyle('width'); //Returns "300px". $('myElement').getStyle('width').toInt(); //Returns 300.
Applies a collection of styles to the Element.
myElement.setStyles(styles);
$('myElement').setStyles({ border: '1px solid #000', width: 300, height: 400 });
Returns an object of styles of the Element for each argument passed in.
var styles = myElement.getStyles(property[, property2[, property3[, ...]]]);
$('myElement').getStyles('width', 'height', 'padding'); //returns {width: "10px", height: "10px", padding: "10px 0px 10px 0px"}
This documentation is released under a Attribution-NonCommercial-ShareAlike 3.0 License.