我根本无法让 jscrollplane 工作。它无法识别 JavaScript。我在做什么?请帮忙
我正在建立一个网站并想使用 jscrollpane。我访问了jscrollpane.kelvinluck.com,这是一个很棒的网站,而且非常有帮助。但我根本无法让它再次工作。我做错了什么? 这是我的代码,我只是无法找出错误在哪里:
.滚动窗格, .滚动窗格箭头 { 宽度:100%; 高度:200px; 溢出:自动; } .仅水平 { 高度:自动; 最大高度:200px; }
$(function() { $('.scroll-pane').jScrollPane(); $('.scroll-pane-arrows').jScrollPane( { showArrows: true, horizontalGutter: 10 } ); });<div id="main_context">
<div class="scroll-pane-arrows horizontal-only">
<p style="width: 1000px;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec in ligula id sem tristique ultrices
eget id neque. Duis enim turpis, tempus at accumsan vitae, lobortis id sapien. Pellentesque nec orci
mi, in pharetra ligula. Nulla facilisi. Nulla facilisi. Mauris convallis venenatis massa, quis
consectetur felis ornare quis. Sed aliquet nunc ac ante molestie ultricies. Nam pulvinar ultricies
bibendum. Vivamus diam leo, faucibus et vehicula eu, molestie sit amet dui. Proin nec orci et elit
semper ultrices. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus
mus. Sed quis urna mi, ac dignissim mauris. Quisque mollis ornare mauris, sed laoreet diam malesuada
quis. Proin vel elementum ante. Donec hendrerit arcu ac odio tincidunt posuere. Vestibulum nec risus
eu lacus semper viverra.
</p>
</div>
</div>
i'm builidng a website and want to use a jscrollpane. i went tojscrollpane.kelvinluck.com and its a great site and really helpful. but i can't get it to work again at all. what am i doing wrong?
here is my code, i just can't work out where the errors are:
.scroll-pane,
.scroll-pane-arrows
{
width: 100%;
height: 200px;
overflow: auto;
}
.horizontal-only
{
height: auto;
max-height: 200px;
}
$(function()
{
$('.scroll-pane').jScrollPane();
$('.scroll-pane-arrows').jScrollPane(
{
showArrows: true,
horizontalGutter: 10
}
);
});
<div id="main_context">
<div class="scroll-pane-arrows horizontal-only">
<p style="width: 1000px;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec in ligula id sem tristique ultrices
eget id neque. Duis enim turpis, tempus at accumsan vitae, lobortis id sapien. Pellentesque nec orci
mi, in pharetra ligula. Nulla facilisi. Nulla facilisi. Mauris convallis venenatis massa, quis
consectetur felis ornare quis. Sed aliquet nunc ac ante molestie ultricies. Nam pulvinar ultricies
bibendum. Vivamus diam leo, faucibus et vehicula eu, molestie sit amet dui. Proin nec orci et elit
semper ultrices. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus
mus. Sed quis urna mi, ac dignissim mauris. Quisque mollis ornare mauris, sed laoreet diam malesuada
quis. Proin vel elementum ante. Donec hendrerit arcu ac odio tincidunt posuere. Vestibulum nec risus
eu lacus semper viverra.
</p>
</div>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否链接到 jQuery js 和 jscrollpane js?正确的文档类型怎么样?
Did you link to both the jQuery js and the jscrollpane js? How about a proper doctype?
我对该插件没有太多经验,但这应该是一个非常简单的修复。尝试将类名“scroll-pane-arrows”替换为“scroll-pane”,看看是否适合您。您还可以查看文档:http://jscrollpane.kelvinluck.com/
I don't have much experience with the plugin, but this should be a pretty easy fix. Try replacing the class name "scroll-pane-arrows" with "scroll-pane" and see if that works out for you. You might also have a look over the documentation: http://jscrollpane.kelvinluck.com/