使用 jScrollPane 时移动/重新定位滚动条
我一直在寻找答案,但到目前为止还没有运气。
目前,滚动条和箭头位于同一位置内 div 作为可滚动内容 - 在大多数情况下这是有意义的。我 想知道是否有办法放置滚动条和箭头 在 html 页面的不同位置中的这个 div 之外?有没有 一种指定他们应该去的地方的方法?
示例:
<div id="content">
Lorem ipsum....
</div>
变成:
<div id="content">
<div class="scrollpane">
Lorem ipsum....
</div>
<div class="scroll-bar">
### scroll bar and arrows here ###
</div>
</div>
但我想得到这个:
<div id="content">
<div class="scrollpane">
Lorem ipsum....
</div>
</div>
[other html other html and content other html]
<div id="scrollbar-here">
### scroll bar and arrows here ###
</div>
非常感谢任何帮助,或者我错过的答案的链接 同样会有帮助。我正在使用 jquery1.4.3 和 jScrollPane - v2.0.0beta6
I've had a look for the answer but with no luck so far.
At the moment the scrollbar and arrows are postioned inside the same
div as the scrollable content - which in most cases makes sense. I
want to know if there is a way to place the scrollbar and arrows
outside of this div in a different location in the html page? Is there
a way to specify the place they should go?
Example:
<div id="content">
Lorem ipsum....
</div>
Gets turned into:
<div id="content">
<div class="scrollpane">
Lorem ipsum....
</div>
<div class="scroll-bar">
### scroll bar and arrows here ###
</div>
</div>
But I want to get this:
<div id="content">
<div class="scrollpane">
Lorem ipsum....
</div>
</div>
[other html other html and content other html]
<div id="scrollbar-here">
### scroll bar and arrows here ###
</div>
Any help much appreciated, or a link to the answer that I've missed
would be equally helpful. I'm using jquery1.4.3 and jScrollPane -
v2.0.0beta6
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚回答了您向谷歌小组提出的问题:
http://groups.google.com/group/jscrollpane/browse_thread/thread/ff2e10b8d784fed6
这是其他搜索者的答案:
不幸的是,目前不支持。您可以尝试通过以下几种方法来实现它:
$('#myDiv').append($('.jspVerticalBar'));
) - 不保证这不会有一些奇怪的不过有副作用!希望它能给你一些想法。如果你想将其作为功能请求添加到 github 问题列表中,那么我会尝试在将来查看它(不过不会很快 - 我现在真的很忙于客户工作) 。
I just answered this question where you had posed it to the google group:
http://groups.google.com/group/jscrollpane/browse_thread/thread/ff2e10b8d784fed6
Here is the answer for other searchers:
Unfortunately that isn't currently supported. There are a few of ways you could attempt to achieve it:
$('#myDiv').append($('.jspVerticalBar'));
) - no guarantees this won't have some strange side effects though!Hope it gives you some ideas. If you want to add this as a feature request on the github issues list then I'll try to look at it in the future (it'll won't be soon though - I'm really busy with client work at the moment).
由于某种原因,我无法评论 vitch 的答案,但我只是想为来到此页面的任何人记录选项 3 和一些简单的 CSS 调整(主要是将 .jspContainer 上的position:absolute 切换为position:relative)的效果我。
For some reason I can't comment on vitch's answer but I just wanted to document for anyone coming to this page that option 3 and some simple CSS adjustments (the main one being switching position:absolute to position:relative on .jspContainer) worked for me.