Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
a horizontal slider, or range-slider similar to jquery-ui
JavaScript CSS
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
History.md
Makefile
Readme.md
component.json
example.html
index.js
slider.css
template.html
template.js

Readme.md

slider

a simple horizontal slider or range-slider with touch support.

Installation

Install with component(1):

$ component install bmcmahen/slider

Use

var Slider = require('slider');
var range = new Slider()
  .numberRange(0, 100)
  .addHandle()
  .addHandle()
  .appendTo(document.body)
  .setValue(20, 50);

// when adding a second handle, the slider assumes that you
// want a range slider.

// listen for when the value of our first handle changes
range.on('val', function(v){
  console.log('ONE', v)
});

// listen for when the value of our second handle changes
range.on('val2', function(v){
  console.log('TWO', v);
});

// refresh the slider when the window resizes
window.onresize = function(){
  range.refresh();
};

License

MIT

Something went wrong with that request. Please try again.