vertical axis Control.Slider problem

16 views
Skip to first unread message

Walter Lee Davis

unread,
Nov 2, 2009, 2:16:01 PM11/2/09
to prototype-s...@googlegroups.com
Can anyone tell me why these two different formats of the
Control.Slider would behave differently?

vas s = new Control.Slider('thumb','track');
s.options = {
axis: 'vertical',
onChange: function('value'){
customSlide(value,this.axis,this.moveMe);
},
onSlide: function(value){
customSlide(value,this.axis,this.moveMe);
},
moveMe: $('innerBox')
}

vas s = new Control.Slider('thumb','track',{axis: 'vertical'});
s.options = {
onChange: function('value'){
customSlide(value,this.axis,this.moveMe);
},
onSlide: function(value){
customSlide(value,this.axis,this.moveMe);
},
moveMe: $('innerBox')
}

The first one works, in that it moves the innerBox up and down. But
the slider behaves as if it was horizontal rather than vertical (so it
moves from side to side across the very narrow width of the track
only). The second one works perfectly, sliding up and down the
vertical track.

Why would adding the axis option in an external options object cause
it to be ignored at setup time? This problem happens in 1.8.2 and
1.8.3, using the 1.6.3 prototype in both cases.

Thanks in advance,

Walter

Reply all
Reply to author
Forward
0 new messages