Flip Toggle Switch

Home Search

Flip toggle switch

The slider plugin has the following options:

disabled boolean

default: false

Sets the default state of the slider to disabled when "true".

$('.selector').slider({ disabled: true });
initSelector CSS selector string

default: "input[type='range'], :jqmData(type='range'), :jqmData(role='slider')"

This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as sliders. To change which elements are initialized, bind this option to the mobileinit event:

$( document ).bind( "mobileinit", function(){
   $.mobile.slider.prototype.options.initSelector = ".myslider";
});
mini boolean

default: false

Sets the size of the element to a more compact, mini version. This option is also exposed as a data attribute: data-mini="true"

$('.selector').slider({ mini: true });
theme string

default: null, inherited from parent

Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to one of the swatches included in your theme. By default, it will inherit the same swatch color as its parent container if not explicitly set. This option is also exposed as a data attribute: data-theme="a"

$('.selector').slider({ theme: "a" });
trackTheme string

default: null, inherited from parent

Sets the color scheme (swatch) for the slider's track, specifically. It accepts a single letter from a-z that maps to one of the swatches included in your theme.

$('.selector').slider({ trackTheme: "a" });

This option can be overridden in the markup by assigning a data attribute to the input, e.g. data-track-theme="a".