Beautiful Virtual Scrollbar

Add-ons
2026-07-21 13:01 5 次浏览 • 0 次下载 51.5KB
Beautiful Virtual Scrollbar

Basic configuration

1
$(selector).slimScroll();

Example of additional settings

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$(function() {
$(".slimscroll").slimScroll({
width: 'auto', // Width of the scrollable area
height: '100%', // Height of the scrollable area
size: '10px', // Component width
color: '#000', // Scrollbar color
position: 'right', // Component position: left/right
distance: '0px', // Distance between the component and the sidebar
start: 'top', // Default scroll position: top/bottom
opacity: .4, // Scrollbar opacity
alwaysVisible: true, // Whether to always display the component
disableFadeOut: false, // Whether to display the component when the mouse hovers over the scrollable area and hide it when the mouse leaves
railVisible: true, // Whether to display the track
railColor: '#333', // Track color
railOpacity: .2, // Track opacity
railDraggable: true, // Whether the scrollbar is draggable
railClass: 'slimScrollRail', // Track div class name
barClass: 'slimScrollBar', // Scrollbar div class name
wrapperClass: 'slimScrollDiv', // Wrapper div class name
allowPageScroll: true, // Whether to scroll the window when the mouse wheel reaches the top/bottom
wheelStep: 20, // Mouse wheel scroll amount
touchScrollStep: 200, // Scroll amount when the user uses touch gestures
borderRadius: '7px', // Scrollbar border radius
railBorderRadius: '7px' // Track border radius
});
});

Events

slimScroll publishes slimscroll event when scrollbar reaches top or bottom of the parent container. You can use jQuery bind method to subscribe to this event:

1
2
3
$(selector).slimScroll().bind('slimscroll', function(e, pos){
console.log("Reached " + pos");
});
星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare