Dojo slider: update value dynamically
- by xApple
I am building an application where the user browses certain objects by scrolling and zooming. To change the zoom level I have successfully implemented a "dijit.form.HorizontalSlider" object. Every time the user changes the position of the silder, I can catch the "onChange" call and do something with that.
However, the user can also zoom-in by double clicking inside the view zone, at which point the slider should change position automatically to reflect the new zoom level.
My question is the following: what function or method should I call in my javascript to update the position of a dojo silder ?
Here is the code that creates the silder object:
var zoomSlider = new dijit.form.HorizontalSlider({
name: "zoom_slider",
id: "zoom_slider",
value: 0,
minimum: 0,
maximum: 19,
discreteValues: 20,
intermediateChanges: false,
style: "width: 160px;",
onChange: function(value) {
brwsr.view.zoomTo(value);
}
},
"zoom_slider");
navbox_silder.appendChild(zoomSlider.domNode);