jQuery plugin to translate standard CSS measurements to pixel units
Version 1.2
Copyright (c) 2011-2015 Martijn W. van der Lee Licensed under the MIT.
Measure an amount of CSS3 units in pixels, relative to a specified context if available. Based on http://www.filamentgroup.com/lab/update_jquery_plugin_for_retaining_scalable_interfaces_with_pixel_to_em_con/
$(<context>).px(<size>);
$.px(<size>);
The DOM tree node in which to measure. Some units like 'em' and '%' are relative to the current font size. If not specified, 'body' will be used for units that require a context.
A number and CSS3 unit or constant that should be measured. The number can be integer or floating point and may be preceded by a sign (-/+). The unit can be any of the following:
Both the number and unit/constant are optional; number will default to '1', unit will default to 'em'.
The measured size in pixel units. If the unit is specified but not recognized, an error will be thrown.
$.px();
$.px('thin');
$.px('small');
$.px('2in');
$.px('200%');
$('#here').px('200%');