Download
User Rating: 0/5 ( 0 votes)
jQuery scrollpanel replaces the native vertical browser scrollbar with a CSS-stylable custom scrollbar. This script is used in h5ai in the tree sidebar.
Source: larsjung.de
1. INCLUDE JS FILES
<script src="jquery-1.10.2.min.js"></script>
<script src="jquery.mousewheel-3.1.3.js"></script>
<script src="../jquery.scrollpanel-{{pkg.version}}.js"></script>
2. HTML
<div id="mycontainer">
Some text content.
<span class="bar"/>
<div class="foo"/>
</div>
3. JAVASCRIPT
$('#mycontainer').scrollpanel();
4. CONFIGURATION
The only option that can be passed to the contructor is a class prefix which defaults to 'sp-'.
$(selector).scrollpanel({
prefix: 'sp-'
});
Styles can freely be applied:
#mycontainer {
width: 140px;
height: 200px;
border: 1px solid #ccc;
.sp-scrollbar {
width: 10px;
margin: 4px;
background-color: #ccc;
cursor: pointer;
.sp-thumb {
background-color: #aaa;
}
}
.sp-scrollbar.active
.sp-thumb {
background-color: #999;
}
}
}