views:

32

answers:

2

Hi Folks, I just included jQuery jScrollPane plugin in to my page and it seems to be working fine except one small issue. I want to decrease the size(height) of scrollBar tab (where we click to drag the scroll bar up and down). I have attached the current snapshot of it as you can see how long it is. On the example site, it shows up fine.

Src: http://jscrollpane.kelvinluck.com/themes/lozenge/

Note: I am talking about the Dark Colored Area on the snapshot.

alt text

A: 

The height of the dark element is dynamically calculated based on the contents and size of the pane.

Within the jScrollPane js you'd need to adjust the calculation of verticalDragHeight

Search for...

verticalDragHeight = 1 / percentInViewV * verticalTrackHeight;

The trouble is, if you do alter this it could (and probably would) affect the display of the scroll bar under certain circumstances. For example, you wouldn't need a scroll bar if the contents of the pane is smaller than the size of the pane right? Adjusting the verticalDragHeight could effect that determination.


Just in case I misunderstood the question, you are defining the height of your pane right? I.e...

.scroll-pane
{
    height: 200px;
}
Julian Young
Hi Julian, Thanks for the reply. Yes I am defining the height. In my case, the height is 700 px;
t3ch
You are right, it might affect its use. I thought there might be some easy CSS hack to do this :)
t3ch
You could extend the height in the javascript by altering the percentInViewV but what'll you notice is the dark coloured part will move outside the confines of the scroll bar either at the top or at the bottom.
Julian Young
+1  A: 

If you want to reduce the size of the "drag" element there are some properties you can pass into the plugin to do so. Please see this example:

http://jscrollpane.kelvinluck.com/drag_size.html

vitch
Good find! Trust me not to look at the instructions :)
Julian Young