简体   繁体   English

是否可以强制jQuery.jScrollPane始终显示垂直滚动条?

[英]Is it possible to force jQuery.jScrollPane to always show a vertical scroll-bar?

Is it possible to force jQuery.jScrollPane to always show a vertical scroll-bar? 是否可以强制jQuery.jScrollPane始终显示垂直滚动条?

eg hidden setting, API function? 例如隐藏设置,API函数?

Preferably without touching the content pane, its height etc. 最好不要触摸内容窗格,其高度等。

Unfortunately this isn't currently possible with jScrollPane. 不幸的是,jScrollPane目前无法实现这一目标。 There is an open feature request for it though: 但是有一个开放的功能请求:

https://github.com/vitch/jScrollPane/issues#issue/8 https://github.com/vitch/jScrollPane/issues#issue/8

As a workaround for now you could place an element with a min-height directly inside your scrollpane to force the scrollbar like in this example: 作为现在的解决方法,您可以在滚动窗格中直接放置一个具有最小高度的元素来强制滚动条,如下例所示:

http://www.jsfiddle.net/vitch/5D8sR/ http://www.jsfiddle.net/vitch/5D8sR/

Hope it helps! 希望能帮助到你!

another method which I've confirmed will work is to add a new parameter "alwaysShowScroll:true" and make two changes in jquery.jscrollpane.js: 我已经确认的另一种方法是添加一个新参数“alwaysShowScroll:true”并在jquery.jscrollpane.js中进行两处更改:

~line 176, change if (!(isScrollableH || isScrollableV)) { 〜第176行,改变if (!(isScrollableH || isScrollableV)) {
to if (!(isScrollableH || isScrollableV || settings.alwaysShowScroll)) { to if (!(isScrollableH || isScrollableV || settings.alwaysShowScroll)) {

~line 241, change if (isScrollableV) { 〜第241行,改变if (isScrollableV) {
to if (isScrollableV || settings.alwaysShowScroll) { to if (isScrollableV || settings.alwaysShowScroll) {

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

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