Custom scrollbars for modern webapps
Download v3 orbower install optiscroll
|npm install optiscroll
new Optiscroll(element)
or if you prefer the jQuery flavour
$('selector').optiscroll()
Try it out:
Don't see any difference?
By default Optiscroll does not create custom scrollbars on iOS, Android
and OSX w/ trackpad. However, the API and the custom events will work across all platforms.
new Optiscroll(element, { forceScrollbars: true })
or if you prefer the jQuery flavour
$(element).optiscroll({ forceScrollbars: true })
If you decide to force the scrollbars, they will be created on all platform. However, this is not recommended because on iOS the position will be updated when the momentum scrolling ends.
Scroll to a specific point with a nice animation. If you need to scroll a single axis then set the opposite axis destination to false. Duration could be auto (based on the distance) or in milliseconds.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.
Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem.
Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum.
Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima.
Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum
Scrolls the element into view. The alignment will be driven by the nearest edge. Duration could be auto (based on the distance) or in milliseconds. Delta is an optional distance from the edge.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.
Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem.
Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum.
Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima.
Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum
clientWidth
/clientHeight
changes of the optiscroll element, or on scrollWidth
/scrollHeight
changes of the scroll area.
scrollstop
event gets fired.
See scrollstop
event for further details.
scrollMinUpdateInterval
value.
scrollStopDelay
option.
scrollreachtop
, scrollreachbottom
, scrollreachleft
, scrollreachright
. The "generic" event name is fired before the specific one.