Custom scrollbar height in jScrollPane jquery plugin

I am using the jScrollPane jQuery plugin (http://jscrollpane.kelvinluck.com) to implement a custom scrollbar in my application.

However, I need to be able to change the height of the jspDrag element. It seems that the height of the element depends on the amount of content inside the div. However, I want to use an image (which should be a fixed size ie not repeated) for jspDrag, and the image will be very small (smaller in height than the actual jspDrag element).

How to do it?

+4
source share
1 answer

The plugin provides some properties for controlling the minimum / maximum height / width of scrollbars:

  • verticalDragMinHeight
  • verticalDragMaxHeight
  • horizontalDragMinWidth
  • horizontalDragMaxWidth

Check out the plugin settings page .

Setting the same value for min / max will fix the height / width:

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

Below is an example in jsfiddle .

+12
source

Source: https://habr.com/ru/post/1387020/


All Articles