Search code examples
jqueryjscrollpane

jScrollpane does not take the border-width into account


The jScrollPane jquery plugin allows to style a scrollable zone. Great, except that the design i must implement uses the borders, but the plugin does not take the height into account.

To see where the problem is, scroll down the scrollable area. When the jspDrag element has reached the bottom, its border-bottom disappears. I would like that it stays in the visible part.

Demo: http://jsfiddle.net/pixeline/nsAny/

This demo uses the plugin basic CSS, and this:

$('.scroll-pane').jScrollPane({
    showArrows: false,
    scrollbarWidth: 11
});

CSS:

.scroll-pane {
        height: 440px;
        overflow: auto;
    }

.jspDrag{
    border:1px solid green;
}

Is there a way to fix this without hacking the code?


Solution

  • Hey I had the same problem and "fixed" it via a workaround. There is a line (#286 on version 2.0.17): verticalTrackHeight = paneHeight;

    I changed it to : verticalTrackHeight = paneHeight-2; Now I have a red line at the bottom, I need black so modified the background colour of the jspVerticalBar class in the css.

    Hope this helps, no other functionality seems affected yet...