62 lines
1.3 KiB
JavaScript
62 lines
1.3 KiB
JavaScript
document.addEventListener("DOMContentLoaded", function(event) {
|
|
var valuesForSlider = [2,3,4,5];
|
|
|
|
var format = {
|
|
to: function(value) {
|
|
return valuesForSlider[Math.round(value)];
|
|
},
|
|
from: function (value) {
|
|
return valuesForSlider.indexOf(Number(value));
|
|
}
|
|
};
|
|
var slider = document.getElementById('slider');
|
|
noUiSlider.create(slider, {
|
|
start: [2, 3],
|
|
connect: true,
|
|
tooltips: true,
|
|
step: 1,
|
|
range: {
|
|
'min': 0,
|
|
'max': valuesForSlider.length - 1
|
|
},
|
|
format: format
|
|
});
|
|
});
|
|
|
|
(function($){
|
|
$(function(){
|
|
|
|
$('.sidenav').sidenav();
|
|
|
|
}); // end of document ready
|
|
$(document).ready(function(){
|
|
// slider
|
|
// var valuesForSlider = [2,3,4,5];
|
|
// var slider = document.getElementById('slider');
|
|
// var format = {
|
|
// to: function(value) {
|
|
// return valuesForSlider[Math.round(value)];
|
|
// },
|
|
// from: function (value) {
|
|
// return valuesForSlider.indexOf(Number(value));
|
|
// }
|
|
// };
|
|
//
|
|
// noUiSlider.create(slider, {
|
|
// start: [3, 4],
|
|
// connect: true,
|
|
// step: 1,
|
|
// orientation: 'horizontal', // 'horizontal' or 'vertical'
|
|
// range: {
|
|
// 'min': 0,
|
|
// 'max': valuesForSlider.length - 1
|
|
// },
|
|
// format: wNumb({
|
|
// decimals: 0
|
|
// })
|
|
// });
|
|
|
|
});
|
|
})(jQuery); // end of jQuery name space
|
|
|