ok so I'm trying to use jscrollpane plugin for jquery and it works fine. The issue is i'm trying to achieve an affect that requires the scroll bar to be outside the containing div that is initially passed to it when initialized. I got this working by simply changing this:
container.append(
$('<div class="jspVerticalBar" />').append(
$('<div class="jspCap jspCapTop" />'),
$('<div class="jspTrack" />').append(
$('<div class="jspDrag" />').append(
开发者_如何学C $('<div class="jspDragTop" />'),
$('<div class="jspDragBottom" />')
)
),
$('<div class="jspCap jspCapBottom" />')
)
);
verticalBar = container.find('>.jspVerticalBar');
To this:
container.parent().parent().append(
$('<div class="jspVerticalBar" />').append(
$('<div class="jspCap jspCapTop" />'),
$('<div class="jspTrack" />').append(
$('<div class="jspDrag" />').append(
$('<div class="jspDragTop" />'),
$('<div class="jspDragBottom" />')
)
),
$('<div class="jspCap jspCapBottom" />')
)
);
verticalBar = container.parent().parent().find('>.jspVerticalBar');
The issue however is that when the content doesn't require a scroll bar it still resizes the pane to leave space for the scroll bar. I can't seem to track down the issue. I'm still fairly new to jquery so it's been rough trying to debug this so any help would be greatly appreciated.
NM! I think I got it! Found the "destroy()" function in the API. I added that in at the end of when both V and H scrolls are false "
if (!(isScrollableH || isScrollableV)) {
That strips out everything and keeps the formatting happy.
精彩评论