Dojo slider: update value dynamically

Posted by xApple on Stack Overflow See other posts from Stack Overflow or by xApple
Published on 2010-12-28T16:54:29Z Indexed on 2010/12/28 19:54 UTC
Read the original article Hit count: 253

Filed under:
|
|
|

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);

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html