A jQuery plugin for cross browser range inputs.
range.js
range.css
jQuery
core.js
touch.js
Range will convert an input into a customizable slider interface:
$("input[type=range]").range();
<input type="range">
Range will automatically detect the minimum, maximum and increment values based on the min
, max
and step
attributes:
<input type="range" min="2" max="20" step="2">
Create a vertical slider with the orient
attribute:
<input type="range" orient="vertical">
Set instance options by passing a valid object at initialization, or to the public defaults
method. Custom options for a specific instance can also be set by attaching a data-range-options
attribute to the target elment. This attribute should contain the properly formatted JSON object representing the custom options.
Name | Type | Default | Description |
---|---|---|---|
customClass |
string |
'' |
Class applied to instance |
fill |
boolean |
false |
Flag to draw fill |
formatter |
function |
false |
Value format function |
labels |
boolean |
true |
Flag to draw labels |
labels.max |
string |
Max value label; defaults to max value | |
labels.min |
string |
Min value label; defaults to min value | |
theme |
string |
"fs-light" |
Theme class name |
vertical |
boolean |
false |
## Methods
Methods are publicly available to all active instances, unless otherwise stated.
Extends plugin default settings; effects instances created hereafter.
$.range("defaults", { ... });
Name | Type | Default | Description |
---|---|---|---|
options |
object |
{} |
New plugin defaults |
Removes plugin instance.
$(".target").range("destroy");
Disables target instance
$(".target").range("disable");
Enables target instance
$(".target").range("enable");
Resizes instance
$(".target").range("resize");
Updates instance.
$(".target").range("update");
## CSS
Class | Type | Description |
---|---|---|
.fs-range-element |
element |
Target elmement |
.fs-range |
element |
Base widget class |
.fs-range.fs-range-focus |
modifier |
Indicates focused state |
.fs-range.fs-range-disabled |
modifier |
Indicates disabled state |
.fs-range.fs-range-labels |
modifier |
Indicates label display |
.fs-range.fs-range-vertical |
modifier |
Indicates vertical display |
.fs-range-track |
element |
Track elmement |
.fs-range-fill |
element |
Fill elmement |
.fs-range-handle |
element |
Handle elmement |
.fs-range-marker |
element |
Marker elmement |
.fs-range-label |
element |
Label elmement |
.fs-range-label_min |
element |
Minimum label elmement |
.fs-range-label_max |
element |
Maximum label elmement |