Jquery Superbox + jScrollPane问题
大家好,感谢阅读本文: 好吧,我遇到了这个问题,我尝试使用 Superbox 和 jScrollPane。 我得到了一些内联内容,Superbox 很好地加载了(作为模式),但没有出现滚动条(jScrollPane),所以我无法滚动内容。如果有帮助一些代码:
HOW SUPERBOX JSCROLLPPANE:
$(function(){
$.superbox.settings = {
closeTxt: "Close",
loadTxt: "Loading...",
nextTxt: "Next",
prevTxt: "Previous"
};
$.superbox();
$('.scroll-pane').jScrollPane();
});
我如何调用/打开灯箱:
<li><a href="#about" rel="superbox[content]">About</a></li>
内联内容的 HTML:
<div id="infos" style="display:none;">
<div id="acerca" class="scroll-pane">
<h2>Content mode</h2>
<p>Generates a box containing an element of the page.</p>
</div>
</div>
感谢您的时间和知识!
Hello guys and thanks for read this:
Well im getting this problem, im trying to use Superbox and jScrollPane.
I got some inline content that nicely Superbox load (As modal) but no scrollbars (jScrollPane) appears so i cant scroll the content. If helps some code:
HOW SUPERBOX JSCROLLPANE:
$(function(){
$.superbox.settings = {
closeTxt: "Close",
loadTxt: "Loading...",
nextTxt: "Next",
prevTxt: "Previous"
};
$.superbox();
$('.scroll-pane').jScrollPane();
});
HOW I CALL/OPEN THE LIGHTBOX:
<li><a href="#about" rel="superbox[content]">About</a></li>
THE HTML FOR INLINE CONTENT:
<div id="infos" style="display:none;">
<div id="acerca" class="scroll-pane">
<h2>Content mode</h2>
<p>Generates a box containing an element of the page.</p>
</div>
</div>
Thanks for your time and knowledge!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您调用
$('.scroll-pane').jScrollPane();
但您没有在页面上显示scroll-pane
类的元素。必须有与您应用 jScrollPane 的选择器相匹配的内容。另外,您可能只想在超级框打开后初始化 jScrollPane。我快速浏览了超级盒页面,不幸的是他们似乎没有提供任何事件,所以我不确定是否有办法找出超级盒何时被打开。您可以尝试这样做:
这将暂时显示信息框并在其上初始化 jScrollPane (您无法在隐藏元素上初始化 jScrollPane),然后再次隐藏它。然后当超级框显示它时 jScrollPane 应该就位......
You call
$('.scroll-pane').jScrollPane();
but you don't show an element on your page with a class ofscroll-pane
. There must be something matching the selector that you apply jScrollPane to.Also, you probably only want to initialise jScrollPane once the superbox has opened. I had a quick look at the superbox page and unfortunately they don't seem to provide any events so I'm not sure if there is a way to find out when a superbox has been opened. You could try this instead:
This will temporarily show the info box and initialise jScrollPane on it (you can't initialise jScrollPane on hidden elements) and then hide it again. Then when superbox shows it jScrollPane should be in place...