Material Design-style Custom Range Slider Plugin With jQuery - rangeslider.js

File Size: 17.7 KB
Views Total: 10351
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Material Design-style Custom Range Slider Plugin With jQuery - rangeslider.js

rangeslider.js is a really small jQuery plugin which makes use of JavaScript and CSS/CSS3 to create animated, customizable, touch-enabled and Android- / Material Design-style range sliders to present percentage values.

How to use it:

1. Include the rangeslider.css inside the head tag and the rangeslider.js just before we close the body tag.

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

2. Create an element that will be served as the container for your range slider.

<div id="range">

3. Initialize the plugin with some options to render a basic range slider inside the DIV element you just created.

new RangeSlider($("#range"), {
    size: 1,
    borderSize: 0.4,
    percentage: 100

4. All plugin options.

  • size: Size of the bar in em
  • ratio: The ratio of bar/circle
  • multiple: The multiple of the size the circle reaches when clicked
  • borderSize: The size of the border that surrounds the circle
  • percentage: Starting position
  • fgcolour: bar and circle color
  • bgclolour: background color

5. Optional events and methods.

  • onDown: when a finger touches the slider
  • onTMove: when a finger touches the slider and moves
  • onUp: when the finger is over the slider
  • setBar(percentage): set a specified percentage
  • disable(): disable the plugin
  • enable(): re-enable the plugin



  • Properly bind touch events


  • Fixed disable() and enable() functions


  • Added .enable() and .disable() functions, as well as fgColour and bgColour options.


  • Renamed onTouchDown, onTouchMove and onTouchUp to onUp, onMove and onUp. 
  • Added error checking for percentage input. 
  • Replaced tabs with spaces in CSS file


  • Forced box-sizing to content-width for all children of a rangeslider element

This awesome jQuery plugin is developed by domsleee. For more Advanced Usages, please check the demo page or visit the official website.