我在我的网络应用程序中使用 jquery jscrollpane 插件http://jscrollpane.kelvinluck.com/ 。我想用它只在水平位置滚动。
如此处所示http://jscrollpane.kelvinluck.com/basic.html
这是我的html:
<div class="addbox horizontal-only scrollpane">
<h4><span class="addbox-text">Pick your best work from <b class="highlight-text">Flickr</b> to display in your portfolio</span></h4>
<div class="addmenu-item"><span class="addmenu-image"><img class="addmenuimage" src="http://farm8.staticflickr.com/7122/7424355198_72620895bd_m.jpg"></span><span class="addmenu-info">Orchid Profiles</span></div>
<div class="addmenu-item"><span class="addmenu-image"><img class="addmenuimage" src="http://farm8.staticflickr.com/7122/7424355198_72620895bd_m.jpg"></span><span class="addmenu-info">Orchid Profiles</span></div>
</div>
CSS:
.scroll-pane
{
height: auto;
max-height: 400px;
overflow: auto;
}
.horizontal-only
{
height: auto;
max-height: 200px;
}
查询:
$(".addbox").jScrollPane();
但它不起作用(高度搞砸了,jscrollpane 处于垂直位置)。这是其余代码的css https://gist.github.com/2984404
谢谢!
更新
请检查这个 jsfiddle http://jsfiddle.net/cWcWb/