views:

36

answers:

1

Quick question...

Is there any way to change the default behavior of a scrollbar from moving one pixel at a time (continuous motion), to jumping say 100px at a time (less continuous more discrete jumps). I have an animation that jumps between pictures and I want to use the scrollbar to show one picture at a time.

Whenever I try changing the behavior of the scrollbar it either jumps all over the place or does some screwy stuff. BTW I'm scrolling the bar, not using arrows to move it. That way I can manually make the animation faster or slower.

+1  A: 

Use the Control.ScrollBar.scrollBy() function to scroll by any number of pixels.

var scrollbar = new Control.ScrollBar('scrollbar_content','scrollbar_track');  

$('scroll_down_50').observe('click',function(event){  
    scrollbar.scrollBy(-50);  
    event.stop();  
});  

EDIT: To disable the scrollbar try: scrollbar.disable()

From: http://livepipe.net/control/scrollbar

Steven
I love you in the most platonic Internet way!!!! Thank you SOOOO MUCH!!! I can't vote the response because I don't have a 15 reputation but thank you!
Kirn
you could mark it as the answer by clicking the checkmark beside it :)
Patricia
Wait one issue tho, it still scrolls normally when I move the scrollbar... premature excitement or am I doing something wrong?Looking at their demo it doesn't move the scrollbar in increments if I drag it.
Kirn
I ended up having to create my own scroll bar but I tagged this as the best solution. Thanks!
Kirn