Skip to content

The simplest JavaScript custom range slider ever!

License

Notifications You must be signed in to change notification settings

taufik-nurrohman/range-slider

Repository files navigation

Simple Custom Range Slider

The simplest JavaScript custom range slider ever!

View Demo

Basic Usage

The required HTML is:

<div id="range-slider-1"></div>

Execution…

Basic

// horizontal slider
RS(document.getElementById('range-slider-1'), function(value, target, event) {
    console.log(value);
});

// vertical slider
RS(document.getElementById('range-slider-1'), function(value, target, event) {
    console.log(value);
}, true);

Advance

RS(document.getElementById('range-slider-1'), {
    value: 1, // initial value
    vertical: false, // vertical or horizontal slider?
    create: function(value, target) {  }, // create event
    start: function(value, target, event) {  }, // start event
    drag: function(value, target, event) {  }, // drag event
    stop: function(value, target, event) {  } // stop event
});

Examples

Folks

Update 2016/07/21: Is now has support for touch devices by default.

  • Added support for touch devices by @beard86 → link

About

The simplest JavaScript custom range slider ever!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published