class method Element.measure
Element.measure(element, property) → Number
Gives the pixel value of
element's dimension specified by
Useful for one-off measurements of elements. If you find yourself
calling this method frequently over short spans of code, you might want
Element.getLayout and operate on the
object itself (thereby taking advantage of measurement caching).
$('troz').measure('width'); //-> 150 $('troz').measure('border-top'); //-> 5 $('troz').measure('top'); //-> 226
Element.measurecan measure the dimensions of an element hidden with CSS (
display: none), but only if its parent element is visible.
This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.