No dependencies required
Demo and usage: DEMO
Pure javascript single/range slider. No dependencies required.
License: MIT License
No dependencies required
Demo and usage: DEMO
The onChange gets fired on page load โ it's a bug, right?
my slider is not working in bootsrap 4 modal, how to fix it?
Hi, when I use this piece of code, the page cannot be opened, it keeps loading and freezes my browser when I add the step parameter.
HI, was using your rSlider, but I couldn't get the range values, so i added getValues
functions. Wanted to know if there are other ways to get the range values instead of just the value or if you will want to add the
getValues
function into your code base
Please add range changing option on keyboard arrow key press
How to identify which value is being selected
How to make this slider browser responsive? The number breaks the line while using the various browsers.
how to add dollar sign before value?
Hello, how do I add a dollar sign before a value? On change erase div ((
After the slider moves to the value, there is a 1-2 sec delay in the event (onChange) firing.
(function () {
'use strict';
var init = function () {
var slider2 = new rSlider({
target: '#price-slider',
values: ['$9', '$19', '$29', '$39'],
range: false,
set: [4],
tooltip: false,
onChange: function (vals) {
console.log(vals)
}
});
};
window.onload = init;
})();
I recommend option for tooltips to appear just when dragged. For cleaner look.
Values could be displayed on each end of the slider all the time.
Great work.
how to set this slider as verticle..?
The rSlider.min.js file (only start shown here)
function() { "use strict"; var t = function(t) { this.input = null, this.inputDisplay = null, this.slider = null, this.sliderWidth = 0, this.sliderLeft = 0, this.pointerWidth = 0, this.pointerR = null, this.pointerL = null, this.activePointer = null, this.selected = null, this.scale = null, this.step = 0, this.tipL = null, this.tipR = null, this.timeout = null, this.valRange = !1, this.values = { start: null, end: null }, this.conf = { target: null, values: null, set: null, range: !1, width: null, scale: !0, labels: !0, tooltip: !0, step: null, disabled: !1, onChange: null },
differs from the rSlider,js one
`(function () {
'use strict';
var RS = function (conf) {
this.input = null;
this.inputDisplay = null;
this.slider = null;
this.sliderWidth = 0;
this.sliderLeft = 0;
this.pointerWidth = 0;
this.pointerR = null;
this.pointerL = null;
this.activePointer = null;
this.selected = null;
this.scale = null;
this.step = 0;
this.tipL = null;
this.tipR = null;
this.timeout = null;
this.valRange = false;
this.values = {
start: null,
end: null
};
this.conf = {
target: null,
values: null,
set: null,
range: false,
width: null,
scale: true,
labels: true,
tooltip: true,
step: null,
disabled: false,
onChange: null
};
`
Maybe the .min files haven't been stripped and updated lately?
In my code I have this line:
range_slider.onChange(function (values) { alert() });
When I use the Slider (move with first or second pointer) this callback doesnt fire...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.