General Date & Time pickers Event Calendar Form components Responsive list Numeric pickers Pickers & dropdowns Layout & navigation Tools Accessibility

Temperature

Basic usage

Javascript
$(function () {
    // create a temperature picker
    $("#temp").mobiscroll().temperature({ 
        theme: 'ios', 
        display: 'bottom'
    });
});
HTML
<input id="temp"/>

Options

Name Type Default value Description
defaultUnit String 'c' Default unit, used for min, max and invalid values.
max Number 40 Maximum value.
min Number -20 Minimum value.
unitNames Object { c: '°C', k: 'K', f: '°F', r: '°R' } Display names of the units, which will appear on the unit wheel. If some or all of the units are missing, it will revert to the value from the 'units' array
units Array ['c', 'k', 'f', 'r'] A list containing the conversion units. Possible values:
  • c - Celsius
  • k - Kelvin
  • f - Fahrenheit
  • r - Rankine

Methods

Name Description
setVal(value [, fill ] [, change ] [, temp ] [, time ]) Sets the temperature value.

Parameters

  • value: String - The temperature value.
  • fill (Optional): Boolean - If true, the associated input element is also updated with the new value.
  • change (Optional): Boolean - If false, change event won't be triggered on the input element.
  • temp (Optional): Boolean - If true, only temporary value is set.
  • time (Optional): Number - Specifies the duration of the animation in seconds to scroll the wheels to the new values. There is no animation, if time is omitted or 0.

Example

Methods can be called on an instance. For more details see calling methods
// With selector
$('#mobiscroll').mobiscroll('setVal', '5.00 °C');

// With instance
mobiscrollInstance.setVal('5.00 °C');