
Custom Type 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'}
© Linux.ria.ua, 2008-2024 |