Element Styles
Pretty straight forward:
This paragraph has id = getStyleExample for the examples below.
$('getStyleExample').getStyle('width'); //returns something like "528px"

$('getStyleExample').getStyle('width').toInt(); //returns 528 (an integer)

$('getStyleExample').getStyles('width', 'height'); //returns something like {width:"528px", height:"89px"}

setStyle lets you set a single css property:
$('setStyleExample').setStyle('border', '1px solid black'); $('setStyleExample').setStyle('width', 300);

setStyles has a slightly different syntax, and lets you set as many as you like:
$('setStylesExample').setStyles({ border:'1px solid yellow', backgroundColor:'#666', color:'#fff' });

mootorial/04-element/02-element.style.txt · Last modified: 2008/10/27 23:53 by aaron-n