Simple and lightweight jQuery scrollbar plugin scrollBar.js
Add-ons

Plugin description: This plugin standardizes the scrollbar style within a container. You can customize the scrollbar width and color by modifying CSS.
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.
评论