jquery swipe to select a range of values plug-in

Source: Internet
Author: User
Tags jquery library

Html

First load the jquery library file and Jrange related CSS files: jquery.range.css and plugins: jquery.range.js

<script src="jquery.js"></script> 
<link rel="stylesheet" href="jquery.range.css"> 
<script src="jquery.range.js"></script> 

Then put the following code where you want the slider selector to appear:

<input type="hidden" class="slider-input" value="23" /> 

We used a text field of type Hiiden and set the default value, such as 23.

Jquery

Calling the Jrange plugin is very straightforward and uses the following code directly:

$(‘.single-slider‘).jRange({ 
    from: 0, 
    to: 100, 
    step: 1, 
    scale: [0,25,50,75,100], 
    format: ‘%s‘, 
    width: 300, 
    showLabels: true, 
    showScale: true 
}); 

Then run your page and you will see the effect.

Option settings

Plug-in Jrange also provides some of the necessary option settings to meet a variety of needs.

Options Description Default value
From The minimum value of the sliding range, the number, such as 0
To The maximum value of the sliding range, the number, such as 100
Step Step value, each sliding size 1
Scale The scale label below the slider, the array type, such as [0,50,100] [From,to]
Showlabels Boolean type, whether to show the dimension label below the slider bar True
Showscale Boolean, whether the value label above the slider is displayed True
Format Numeric format '%s '
Width Slide Bar Width 300
Isrange Whether to select a range. False

For more information, please refer to Jrange project website: https://github.com/nitinhayaran/jRange

jquery swipe to select a range of values plug-in

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.