Slider: add to documentation Slider.md

pull/2953/head
thyttan 2023-10-18 21:55:06 +02:00
parent 03a1f10d45
commit 05e2ff899c
1 changed files with 11 additions and 11 deletions

View File

@ -8,7 +8,7 @@ Slider Library
Usage Usage
----- -----
```JS ```js
var Slider = require("Slider"); var Slider = require("Slider");
var slider = Slider(callbackFunction, configObject); var slider = Slider(callbackFunction, configObject);
@ -63,16 +63,16 @@ slider = require("Slider").create(()=>{}, {autoProgress:true})
={ ={
v: { level: 0, ebLast: 0, dy: 0 }, v: { level: 0, ebLast: 0, dy: 0 },
f: { f: {
wasOnDragRect: function (exFirst,eyFirst) { ... }, wasOnDragRect: function (exFirst,eyFirst) { ... }, // Used internally.
wasOnIndicator: function (exFirst) { ... }, wasOnIndicator: function (exFirst) { ... }, // Used internally.
dragSlider: function (e) { ... }, dragSlider: function (e) { ... }, // The drag handler.
remove: function () { ... }, remove: function () { ... }, // Used to remove the drag handler and run the callback function.
updateBar: function (levelHeight) { ... }, updateBar: function (levelHeight) { ... }, // Used internally to get the variable height rectangle for the indicator.
draw: function (level) { ... }, draw: function (level) { ... }, // Draw the slider with the supplied level.
autoUpdate: function () { ... }, autoUpdate: function () { ... }, // Used to update the slider when auto progressing.
initAutoValues: function () { ... }, initAutoValues: function () { ... }, // Used internally.
startAutoUpdate: function (intervalSeconds) { ... }, startAutoUpdate: function (intervalSeconds) { ... }, // `intervalSeconds` defaults to 1 second if it's not supplied when `startAutoUpdate` is called.
stopAutoUpdate: function () { ... } stopAutoUpdate: function () { ... } // Stop auto progressing and clear some related values.
}, },
c: { initLevel: 0, horizontal: false, xStart: 127, width: 44, c: { initLevel: 0, horizontal: false, xStart: 127, width: 44,
yStart: 4, height: 166, steps: 30, dragableSlider: true, yStart: 4, height: 166, steps: 30, dragableSlider: true,