jScrollPane is a jquery plugin which allows you to replace the browsers default vertical scrollbars on any block level element with an overflow:auto style. You can easily control the apperance of the custom scrollbars using simple CSS.
jScrollPane is crossbrowser, working on all browsers that support jquery and it also degrades gracefully. If a user's browser doesn't support jQuery or has JavaScript turned off then they will see the browsers default scrollbars. If the mouse wheel plugin is included in the page then the scroll panes will respond to mouse wheel events as well.
jScrollPane is built on top of the awesome jQuery library and optionally utilises the mouse wheel plugin and the jQEm plugin
There are a number of different examples of different ways you can use jScrollPane:
Here are some examples of jScrollPane being used in the real world - they demonstrate how varied the scroll bars you can create can be.
Just include the following files in the head of your page:
Like so:
<script type="text/javascript" src="scripts/jquery-1.2.6.min.js"></script> <script type="text/javascript" src="scripts/jquery.mousewheel.min.js"></script> <script type="text/javascript" src="scripts/jquery.em.js"></script> <script type="text/javascript" src="scripts/jScrollPane.js"></script> <link rel="stylesheet" type="text/css" media="all" href="styles/jScrollPane.css" />
Then you can use any query selector to select the elements you would like to apply jScrollPane and then initialise it. The following code runs when the document is ready and finds any element with a class of "scroll-pane" and then calls jScrollPane on them.
$(function() { $('.scroll-pane').jScrollPane(); });
You can pass some optional parameters to the jScrollPane function. These take the form of an object with the following attributes:
You can download this plugin in a number of ways. Release version distributions are available from the jScrollPane googlecode site. Or the latest sourcecode is always available in the googlecode subversion repository.
jScrollPane is completely free and open source. However, if you find jScrollPane useful and you would like to make a donation towards my beer fund then please use the paypal button below to donate any amount. Thanks!
Because the element that you turn into a scrollpane is wrapped in another element you can't apply any positional styling to it. This is a shame but the problem is easily avoided by wrapping the element in another div with the positional styling on it (like the divs on this page with a class of holder).
Bug reports and enhancement requests should be made through the jScrollPane issues page on googlecode. All bug reports should include full details of the browser/ OS that the bug appears on and a link to a test URL displaying the bug. This is the only avenue that I can accept bug reports through as otherwise it is too hard to keep track of them.
All support requests should also be made through the jScrollPane issues page on googlecode or through the comments on my jScrollPane project page.