This plugin will add a vertical scrollbar to a layer which has content deeper than its container parent. It will watch if the window has resized, and adjusts itself. The content can be scrolled on devices with touch interface too.
Syntax
$(layer).addScroll({ options });
options
enableKeyboardEnable PgUp and PgDn keys (default = true)enableMouseWheelEnable the mouse wheel (default = true)enableDragEnable dragging the content with the mouse or touch (default = true) Please note, this functionality disables selecting text content within the layer.dragMinSizethe minimum size of the scroll handle (default = 10px)speedthe speed of the scrolling (default = 250ms)effectthe scrolling animation effect (default = ‘easeOutBack’) Other options: ‘swing’ and ‘linear’disabledOpacitythe disabled elements opacity (default = 0.3) (e.g. scroll up button when at the top)wheelIncrthe pixels to scroll on one mousewheel (default = 50)roundingrounding radius of the scrollbar (default = 10px)shadowsCSS3 shadow effects (default = true)gapthe horizontal gap between the content and the scrollbar (default = 3px)
Example
[read-code path="/static/addscroll-plugin/sample.html"]
Requirements
License
Available for use in all personal or commercial projects under both MIT and GPL licenses.
Copyright (c) 2012 Laszlo Molnar