Sign inSign up

Simple and lightweight jQuery scrollbar plugin scrollBar.js

Add-ons
2026-07-25 22:28 4 views • 0 downloads 13.7KB
Simple and lightweight jQuery scrollbar plugin scrollBar.js

Usage:

1. Required files to include:

1
jquery.js,scrollBar.js,scrollBar.css;

2. Initialization:

1) jQuery selector

1
.scrollBar();// This is the most basic initialization method. The scrollbar uses the default style.

2) jQuery selector

1
2
3
4
5
.scrollBar({
barWidth: 10, // Scrollbar width (Enter any desired numeric value here. The default is 10, meaning 10px.)
position: "x,y", // Set to "x" for a horizontal scrollbar only, "y" for a vertical scrollbar only, or "x,y" for both horizontal and vertical scrollbars (scrollbars only appear when the content exceeds the container).
wheelDis: 15 // Distance to scroll up or down with each mouse wheel movement. The default is 15 and can be changed as needed.
});

3) Note: After initialization, this scrollbar plugin automatically appears when the content exceeds the container. No scrollbar is displayed when there is insufficient content.