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

一个人想着一个人 提交于 2019-12-12 07:14:20

问题


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

e.g. hidden setting, API function?

Preferably without touching the content pane, its height etc.


回答1:


Unfortunately this isn't currently possible with jScrollPane. There is an open feature request for it though:

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/

Hope it helps!




回答2:


another method which I've confirmed will work is to add a new parameter "alwaysShowScroll:true" and make two changes in jquery.jscrollpane.js:

~line 176, change if (!(isScrollableH || isScrollableV)) {
to if (!(isScrollableH || isScrollableV || settings.alwaysShowScroll)) {

~line 241, change if (isScrollableV) {
to if (isScrollableV || settings.alwaysShowScroll) {



来源:https://stackoverflow.com/questions/4245551/is-it-possible-to-force-jquery-jscrollpane-to-always-show-a-vertical-scroll-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!