Element Styles

Pretty straight forward:

This paragraph has id = getStyleExample for the examples below.

$('getStyleExample').getStyle('width'); //returns something like "528px"
execute this code
$('getStyleExample').getStyle('width').toInt(); //returns 528 (an integer)
execute this code
$('getStyleExample').getStyles('width', 'height'); 
//returns something like {width:"528px", height:"89px"}
execute this code

setStyle lets you set a single css property:

$('setStyleExample').setStyle('border', '1px solid black');
$('setStyleExample').setStyle('width', 300);
execute this code

setStyles has a slightly different syntax, and lets you set as many as you like:

	border:'1px solid yellow',
execute this code

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