0

So, I've been trying to get jScrollPane to work and can't. I feel like a bit of a moron. The website and some fiddles I've seen make it look simple. However, my code doesn't change the styling of the scrollbars at all.

I've added the scripts (there are three in total, the main one and two mouse wheel ones) and the css, still no go.

So I found the following fiddle: http://jsfiddle.net/2nPXf/34/

(looking for to do same, perhaps keep it normal width though)

And I tried to make it work with my code: http://jsfiddle.net/6tUMk/4/

It seems like the following script is what you are supposed to use to trigger things (I created a separate script file with just this in it, leaving the downloaded scripts untouched):

$(function()
{
    $('.scrollpane').jScrollPane();
});

So, I've added the scrollpane class where I want the scrollbar, but none of the additional styling takes hold like it does in the first fiddle I linked.

I looked through the HTML within some of the jScrollPane demos and I see a lot of additional classes being used, jspScrollable, jspContainer, and others. However, from looking at the working fiddle and documentation within the jScrollPane website, it seems like if you set up the script properly, then any element (in my case, .scrollpane) triggered within the .jScrollPane() script should make it work. But I guess I'm missing something?

So, how does this work? What am I missing here?

4

1 回答 1

-1

您忘记将外部链接添加到jquery.jscrollpane.cssjquery.jscrollpane.min.js、(选项)jquery.mousewheel.js

小提琴

PS 把内容放在里面<p></p>,让它看起来更显眼。

于 2013-07-03T19:06:23.543 回答