that_guy
that_guy

Reputation: 67

scrollbar height in jscrollpane (jquery)

I've been messing around for hours now trying to adjust the height of the .jspVerticalBar. it appears that default is setting the height of the bar to 100% of the panes height.

does anyone know where to set this? i'm not talking about the draggable portion, but the entire bar.

for example

currently it's like this:

:up | | | | | :down

but i want to make it smaller.

:up | | | :down

unfortunately i have no code to paste because i don't know what code TO paste :) but the lib is here, if anyone is familiar https://github.com/vitch/jScrollPane

thanks in advance

Upvotes: 0

Views: 2969

Answers (1)

tjm
tjm

Reputation: 7550

Looking at this demo, it seems you need to add "caps" to your scrollbar.

So using the example from that page, something like,

.jspVerticalBar .jspCap
{
    display: block;
    height: 20px;
}

In the example, showArrows:true; is also added to the initialisation of jSrollPane, it's not mentioned whether this is required or not though. (See update)

It doesn't seem to mention how you can add a different sized "cap" to the top than you do the bottom though, which I guess means the scrollbar will always be centred on the content, but I only had a quick look so there may be a way to do this. (See Update)


Update:

Thanks to vitch in his comment. Apparently showArrows:true is not required, and as well as .jspCap you have .jspCapTop, .jspCapBottom, .jspCapLeft, and, .jspCapRight to modify the caps individually.


Pleas note, I haven't used jScrollPane and this is untested, but hopefully it may be helpful.

Upvotes: 1

Related Questions