UI.Slider Class
Extends View
Defined in:
samsara/ui/Slider.js:22
A UI element that creates a slider controllable by mouse and touch events.
A starting value and range is provided, and the user can change the value within
the range by dragging and clicking on the slider.
The slider has a .value
property that defines its value as a stream.
This file comes with an associated CSS file slider.css
Constructor
UI.Slider
(
-
[options]
Parameters:
-
[options]
Object optionalOptions
Example:
var slider = new Slider({
value : 90,
range : [0, 360],
label : 'angle'
});
var rotation = slider.value.map(function(angle){
return Transform.rotate(Math.PI * angle / 180);
});
context.add({transform : rotation}).add(surface);
context.add(slider);