$style.get
Get computed style of element
$style.get( element, property )
element [object]
The target element.property [string]
The CSS property name.
Notes
This function will return the current computed style of element, not the defined value in CSS file. To increase the performance, the property name should have to self-camelCased.
Example
HTML code
<div id="box">This is a box</div> <button onclick="start_style_get()">Get box width</button>
CSS code
#box {
width: 200px;
height: 60px;
font-size: 12px;
background: #5599bb;
padding: 10px;
}JavaScript code
function start_style_get()
{
$style.set( $("box"), "width", "400px" );
alert( $style.get( $("box"), "width" ) );
}
Demonstration
This is a box