number picker rotating slider - Free Download Mobile-first Number Picker In jQuery - Rotating Slider

Free Download Mobile-first Number Picker In jQuery – Rotating Slider

Posted on

This time I will share jQuery Plugin and tutorial about Mobile-first Number Picker In jQuery – Rotating Slider, hope it will help you in programming stack.

number picker rotating slider - Free Download Mobile-first Number Picker In jQuery - Rotating Slider
File Size: 7.65 KB
Views Total: 282
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A really simple and cross-platform jQuery number picker where you can pick a numeric value within a range by simply swiping left and right just like a rotating slider.

In addition, you can directly type the desired value by clicking/tapping anywhere on the number picker.

How to use it:

1. Insert jQuery library and the Rotating Slider plugin’s files in the HTML.

1 <script src="/path/to/cdn/jquery.slim.min.js"></script>
2 <script src="/path/to/rotating-slider.js"></script>
3 <link rel="stylesheet" href="/path/to/rotating-slider.css" />

2. Create an empty container to hold the number picker.

1 <div id="example"></div>

3. Initialize the number picker and define the min/max values as follows:

1 RotatingSlider($("#example"), {
2   min: 1,
3   max: 100
4 })

4. Set the initial value.

1 RotatingSlider($("#example"), {
2   min: 1,
3   max: 100
4 }, 20)

5. Specify the interval (step size) between numbers.

1 RotatingSlider($("#example"), {
2   min: 1,
3   max: 100,
4   step: 0.5
5 }, 20.5)

6. Get the picked value using the setChangeCallback function.

1 RotatingSlider($("#example"), {
2   min: 1,
3   max: 100,
4   step: 0.5
5 }, 20.5).setChangeCallback(function (val) {
6   console.log(val)
7 });