Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Initialisation

Karl edited this page Apr 15, 2018 · 6 revisions

Start out with the input element you want to enable the Rangeable on:

<input type="range" id="myRangeInput">

Now create a new instance. You can pass either a reference to the input or a CSS3 selector string:

const input = document.getElementById('myRangeInput');
const rangeable = new Rangeable(input);

// or

const rangeable = new Rangeable('#myRangeInput');

You can also pass a object as the second parameter to adjust the options:

const rangeable = new Rangeable('#myRangeInput', {
    multiple: true,
    values: [10, 45],
    ...
});

You can also access the instance via the rangeable property attached to the input.

Clone this wiki locally