Sign inSign up

jQuery Custom Scrollbar Plugin scrollBar.js

Add-ons
2026-07-25 22:46 4 views • 0 downloads 5.0KB
jQuery Custom Scrollbar Plugin scrollBar.js

The code includes detailed comments. You can easily change the scrollbar's appearance by modifying the styles.

Class names for the scrollbar content, scrollbar track, and scrollbar thumb

1
2
3
contentSelector: '.scroll_cont', // Scrollable content area
barSelector: '.scroll_bar', // Scrollbar track
sliderSelector: '.scroll_slider' // Scrollbar thumb

If you want to set the scrollbar thumb height manually, locate the following code in scrollBar.js

1
2
3
4
5
6
7
8
// Get the content to determine the scrollbar thumb height
this._initSliderHeight();
// Determine the scrollbar thumb height based on the content
_initSliderHeight: function() {
var rate = this.$cont.height()/this.$cont[0].scrollHeight;
var sliderHeight = rate*this.$bar.height();
this.$slider.css('height',sliderHeight);
},

Comment out