map_howto

This commit is contained in:
Zsolt Ero
2024-01-18 01:46:44 +01:00
parent 2e4b664b25
commit e32079a97f
3 changed files with 19 additions and 19 deletions

View File

@@ -1,15 +1,15 @@
const slider = document.getElementById('support-plans-slider'); const slider = document.getElementById('support-plans-slider')
var arbitraryValuesForSlider = ['128MB', '256MB', '1GB', '8GB', '16GB', '32GB']; var arbitraryValuesForSlider = ['128MB', '256MB', '1GB', '8GB', '16GB', '32GB']
var format = { var format = {
to: function (value) { to: function (value) {
return arbitraryValuesForSlider[Math.round(value)]; return arbitraryValuesForSlider[Math.round(value)]
}, },
from: function (value) { from: function (value) {
return arbitraryValuesForSlider.indexOf(value); return arbitraryValuesForSlider.indexOf(value)
},
} }
};
noUiSlider.create(slider, { noUiSlider.create(slider, {
// start values are parsed by 'format' // start values are parsed by 'format'
@@ -19,4 +19,4 @@ noUiSlider.create(slider, {
tooltips: true, tooltips: true,
format: format, format: format,
pips: { mode: 'steps', format: format, density: 50 }, pips: { mode: 'steps', format: format, density: 50 },
}); })