I'm using noUiSlider and followed the tutorial how to create custom formatting:
noUiSlider.create(sliderFormat, {
start: [ 20 ],
step: 10,
range: {
'min': [ 0 ],
'max': [ 599 ]
},
format: {
to: function ( value ) {
return Math.round(value/60) + ':' + Math.round(value%60);
},
from: function ( value ) {
return value;
}
}
});
When I call
mySlider.get()
it returns a value like 1:10, which is the formatted value. I would like to get the raw value (like 70 in this example), how is that possible?
As Vaibhav Kumar suggestet, I used the update function to read the raw value:
slider.noUiSlider.on('update', function(values,handle,unencoded){
// unencoded contains the raw value
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With