I have implemented a dojo slider for image changing on html canvas. If the slider is incremented we call showNextImage and if the slider is decremented we call showPrevImage. How to implement this? I’ve tried using the onChange function but I can’t get the old value from the slider.
var slider = new dijit.form.HorizontalSlider({
name: "slider",
value: 0,
minimum: 0,
maximum: 10,
discreteValues: 11,
intermediateChanges: true,
style: "width:300px;",
class:"dhSlider",
disabled:false,
container: viewportWrapper,
onChange: function(value) {
var valueNew = a;
if(value > valueNew)
console.debug(valueNew);
var a = value;
}
});
To simplify: I just want a function that tells me if the slider value was incremented or decremented.
Got it working with a global variable.