我根本无法让 jscrollplane 工作。它无法识别 JavaScript。我在做什么?请帮忙

发布于 2024-10-17 05:11:03 字数 1932 浏览 3 评论 0原文

我正在建立一个网站并想使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

等数载,海棠开 2024-10-24 05:11:03

您是否链接到 jQuery js 和 jscrollpane js?正确的文档类型怎么样?

Did you link to both the jQuery js and the jscrollpane js? How about a proper doctype?

狼性发作 2024-10-24 05:11:03

我对该插件没有太多经验,但这应该是一个非常简单的修复。尝试将类名“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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文