Experiment: jQuery Measurement Unit Switcher Plugin


Overview

This plugin takes a class called "hd-munit-switcher" and adds a switcher so users can change the measurement unit. Users can determine the type of measurement with rel and number, which is placed within the tag.

Planned changes include:

Examples

Temperature:
100

Distance:
45

Missing type:
18

Updates other like units:
45

Code

<span class="hd-munit-switcher" rel="temperature">100</span>


Updates

Version 0.1.3 07.17.11
Proper plugin structure. Added options for default units, turning on/off syncing of other like switchers on the page. Fix for empty type. Added meters. Created zip for plugin.
Version 0.1.2 07.10.11
Added a little support for mobile, but am not quite finished, yet.
Version 0.1.1 07.10.11
A little clean up and optimization. Added automatic IDs and preventing error when user forgets measurement type.
Version 0.1.0 07.09.11
Got things working with Fahrenheit, Celsius, kilometers, miles, and yards. Played a bit with Kelvin but needs a little more work.

Types Supported

temperature
Fahrenheit and Celsius
distance
kilometers, miles, yards, meters