This is a plugin written for jQuery which adds a vertical scrollbar to DOM object using the jQuery UI slider. Detects object height/ necessary height to display contents and determines if a scrollbar is necessary. Rewraps content and creates a scrollbar inside existing object.
View the demo here: http://patrickotoole.github.com/jQuery-Vertical-Scroll/index.html
- click
- drag
- wheel (mouse)
- touch (iOS)
The functionality for each of these controls is stubbed out as secondary functions to allow for custom handling, scrolling and animation of events. The increment function is also stubbed for the same purpose. Default functionality and handling of all events is included.
- $('.element').scrollbar();
- $('.element').scrollbar(method, scrollbar_options);
- Create -- creates the scrollbar with specified options $('.element').scrollbar("create", options_hash);
- Destroy -- removes scrollbar $('.element').scrollbar("destroy");
- Refresh -- removes scrollbar and creates scrollbar using original options $('.element').scrollbar("refresh");
- Increment -- external functionality to increment scrollbar $('.element').scrollbar("increment", step);
- location: left or right,
- width: int,
- margin: int,
- end_cap_size : int,
- incrementSize : int,
- horizontalVisible : bool
- inlineStyleForWrapper : bool
- Uses jquery.ui as base for toolbar. Allows for matching css etc.
- No longer dependent on mousewheel.js -- uses if available
- Documentation of exposed functions and expandability forthcoming
- Test suite / test page for various situations in process