jQuery Custom Scrollbar Plugin scrollBar.js
Add-ons

Plugin Description: Allows custom scrollbar styling and supports scrolling by mouse clicks and mouse wheel.
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 areabarSelector: '.scroll_bar', // Scrollbar tracksliderSelector: '.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 heightthis._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
评论