用法
使用 jScrollPane 非常简单。你只需将相关文件包含在文档的 <head> 中:
引入文件
<!-- styles needed by jScrollPane -->
<link type="text/css" href="style/jquery.jscrollpane.css" rel="stylesheet" media="all" />
<!-- latest jQuery direct from google's CDN -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<!-- the mousewheel plugin - optional to provide mousewheel support -->
<script type="text/javascript" src="script/jquery.mousewheel.js"></script>
<!-- the jScrollPane script -->
<script type="text/javascript" src="script/jquery.jscrollpane.min.js"></script>
JS
然后你只需要在 document.ready 上初始化 jScrollPane(使用一个选择器,它会找到你想要应用 jScrollPane 的内容)
$(function()
{
$('.scroll-pane').jScrollPane();
});
2017-08-11