简体   繁体   English

jScrollPane jquery插件中滚动条的自定义高度

[英]Custom height of the scrollbar in jScrollPane jquery plugin

I'm using the jScrollPane jQuery plugin (http://jscrollpane.kelvinluck.com) to implement custom scrollbar in my application. 我正在使用jScrollPane jQuery插件(http://jscrollpane.kelvinluck.com)在我的应用程序中实现自定义滚动条。

However, I need to be able to modify the height of the jspDrag element. 但是,我需要能够修改jspDrag元素的高度。 It seems that the height of the element is dependent on the amount of content inside the div. 看起来元素的高度取决于div内的内容量。 However, I want to use an image (which needs to be fixed size ie non-repeatable) for jspDrag and the image is going to be very small (lesser in height than the actual jspDrag element). 但是,我想为jspDrag使用一个图像(需要固定大小,即不可重复),图像将非常小(高度比实际的jspDrag元素小)。

How do i accomplish this ? 我该如何做到这一点?

The plugin provides some properties to control min/max height/width of the scrollbars: 该插件提供了一些属性来控制滚动条的最小/最大高度/宽度:

  • verticalDragMinHeight verticalDragMinHeight
  • verticalDragMaxHeight verticalDragMaxHeight
  • horizontalDragMinWidth horizo​​ntalDragMinWidth
  • horizontalDragMaxWidth horizo​​ntalDragMaxWidth

Check the settings page of the plugin. 检查插件的设置页面

Setting the same value for min/max will fix the height/width: 为min / max设置相同的值将固定高度/宽度:

$('.scroll-pane').jScrollPane({
    verticalDragMinHeight: 100,
    verticalDragMaxHeight: 100
});

Live example here in jsfiddle . 这里的实例是jsfiddle

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM