Kirn
Kirn

Reputation: 524

Change default scrollbar behavior

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.

Upvotes: 1

Views: 2129

Answers (1)

Steven
Steven

Reputation: 13769

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

Upvotes: 2

Related Questions