Closed stratboy closed 2 years ago
Yeah, you can keep track of the previous values and compare:
noUiSlider.create(slider, { ... });
// Initial values
var previousValues = slider.noUiSlider.get();
slider.noUiSlider.on('change', function(values, handle) {
// compare "values" and "previousValues"
previousValues = values;
});
Ok thank you. For reference, for future users, I paste here another way that I'm using right now:
// code extracted from a Vue component
this.start_values = null;
this.slider.noUiSlider.on('start', function(values, handle, unencoded, tap, positions, noUiSlider){
this.start_values = unencoded;
}.bind(this));
this.slider.noUiSlider.on('end', function(values, handle, unencoded, tap, positions, noUiSlider){
this.start_values = null; // reset
}.bind(this));
this.slider.noUiSlider.on('change', function(values, handle, unencoded, tap, positions, noUiSlider){
// do something with this.start_values
}.bind(this));
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hi, for an app I would need to know, onchange, if the user has broadened or restricted the range, so I need to know if passed values are larger or smaller than the previous ones. Is it some way possible?
Thank you