0

下面是整个 HTML 文件。你需要知道的一切。我已经简化了 HTML 文件以专注于这个问题。问题是 nicescroll 的 railpadding 属性不起作用。它在右侧显示垂直栏杆,仅在左侧添加了填充。如果在右侧和左侧都添加了填充,它不会使垂直条居中。对于水平滚动条,填充根本不起作用。padding 属性的上、右、左、下顺序与一般的 CSS 顺序不同。我想知道这是否重要。Nicescroll 使用起来非常简单,可以做我想做的事。我在使用另一个滚动条小部件时遇到了问题,所以切换到了这个。任何建议,将不胜感激!

 <!DOCTYPE HTML>
 <html>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <head>
 <script>
 $(document).ready(function () {
$('#nice_div').niceScroll({cursorcolor:'#FF0000', autohidemode:'false', 
                         cursorwidth:4, background:'pink', 
             railpadding:{top:1,right:2,left:2,bottom:1}});
 </script>
 <body>

 <div id="nice_div" style="width:200px;height:100px;">A lot of text. A lot of text. A lot of text. A lot of text. A lot of text. A lot of text. A lot of text. A lot of text. A lot of text. A lot of text.
 ================================================ 
 A lot of text. 
 A lot of text. A lot of text. A lot of text. 
 ================================================
 A lot of text. A lot of text. A lot of text. 
 A lot of text. A lot of text.  
</div>
</body>
</html>
4

2 回答 2

2

Samir, the railpadding feature does not seem to work correctly. Beta version 3.5 states that it's fixed; but, it didn't work for me.

As a workaround, if you don't mind equal spacing (top, bottom, left, and right), you could use: cursorborder:"2px solid transparent.

于 2014-01-13T07:49:12.507 回答
2

更改 "var v,a,kp = ["left","right"];" 到 "var v,a,kp = ["left","right","top","bottom"];" 在第 733 行

以及第 1751 行中的“self.cursorheight”到“self.cursorheight - self.opt.railpadding['top'] - self.opt.railpadding['bottom']”

JS 文件已修复jquery.nicescroll.min.js

于 2014-03-02T20:16:15.887 回答