jQuery具有固定高度的滚动条

jQuery具有固定高度的滚动条,jquery,scrollbar,slimscroll,Jquery,Scrollbar,Slimscroll,我正在使用rochal的jQuery插件来显示定制的滚动条。有没有办法使滚动条的高度固定,而不是自动生成?我认为必须生成wheelStep值,但不知道要更改什么。所以,问题是如何制作一个固定大小的滚动条 如果这是不可能的,我也可以使用另一个插件。这是可能的!为此,请执行以下操作: 之后: // sets border radius of the rail railBorderRadius : '7px' 在“7px”之后添加逗号,并: // Use a fixed height for the

我正在使用rochal的jQuery插件来显示定制的滚动条。有没有办法使滚动条的高度固定,而不是自动生成?我认为必须生成wheelStep值,但不知道要更改什么。所以,问题是如何制作一个固定大小的滚动条


如果这是不可能的,我也可以使用另一个插件。

这是可能的!为此,请执行以下操作:

之后:

// sets border radius of the rail
railBorderRadius : '7px'
在“7px”之后添加逗号,并:

// Use a fixed height for the scroll bar
useFixedHeight : true,

// the fixed height of the scroll bar
fixedHeight : 50
替换:

barHeight = Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight);
与:


这是可能的!为此,请执行以下操作:

之后:

// sets border radius of the rail
railBorderRadius : '7px'
在“7px”之后添加逗号,并:

// Use a fixed height for the scroll bar
useFixedHeight : true,

// the fixed height of the scroll bar
fixedHeight : 50
替换:

barHeight = Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight);
与:


我试过一个简单的把戏

首先向滚动条添加一个类,默认情况下它是“slimScrollBar”

barClass:“slimScrollBar\u new”


我试过一个简单的把戏

首先向滚动条添加一个类,默认情况下它是“slimScrollBar”

barClass:“slimScrollBar\u new”