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>
Did you link to both the jQuery js and the jscrollpane js? How about a proper doctype?
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/
精彩评论