0

Below is the entire HTML file. Everything you need to know. I have simplified the HTML file to focus on the problem. The problem is that nicescroll's railpadding property does not work. It shows the vertical railbar on the right with padding added only to its left. It does not center the vertical bar if padding is added on both right and left side. For the horizontal scrollbar, padding simply does not work. The padding property's sequence of top, right, left, bottom is different than the general CSS sequence. I wonder if that matters. Nicescroll is otherwise very simple to use and does what I want. I had problems with another scrollbar widget so switched to this one. Any suggestions would be appreciated!

 <!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>
Sunny
  • 9,245
  • 10
  • 49
  • 79

2 Answers2

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.

LukeAmerica2020
  • 311
  • 4
  • 6
  • 2
    Thanks. I switched to another one... manos.malihu.gr. But will look again at this one. – Sunny Jan 13 '14 at 12:20
2

Change "var v,a,kp = ["left","right"];" to "var v,a,kp = ["left","right","top","bottom"];" in line 733

And "self.cursorheight" in line 1751 to "self.cursorheight - self.opt.railpadding['top'] - self.opt.railpadding['bottom']"

JS File Repaired jquery.nicescroll.min.js