lauriemustafic / jquery-nicescroll

Automatically exported from code.google.com/p/jquery-nicescroll
0 stars 0 forks source link

railpadding ignore top and bottom properties #24

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
With this initialization top and bottom parameters are ignored:

$('.scrollCustomized').niceScroll({
  railpadding: { top:3, right:0, left:0, bottom:3 }
});

I think that the proble is on line 639 of jquery.nicescroll.js 3.0 file.

The line is:
var v,a,kp = ["left","right"]; //"top","bottom"

After this edit:
var v,a,kp = ["left","right","top","bottom"];

all is working well.

Original issue reported on code.google.com by simovinc...@gmail.com on 13 Feb 2013 at 4:03

GoogleCodeExporter commented 8 years ago
Thanks for feedback, I'll fix on next release.

Original comment by inuya...@gmail.com on 3 Apr 2013 at 7:55

GoogleCodeExporter commented 8 years ago
in v 3.4.0 and v3.5.0 beta //"top","bottom" still commented but editing this 
lines doesn't change the problem : bottom & top padding are not taken in 
consideration here for horizontal rail (only vertical one)

So I've added this after railh.addClass('nicescroll-rails'); line 791:

var v,a,kp = ["top","bottom"];
for(var n in kp) {
  a=kp[n];
  v = self.opt.railpadding[a];
  (v) ? railh.css("padding-"+a,v+"px") : self.opt.railpadding[a] = 0;
}

Original comment by s...@getsy.co on 2 Sep 2013 at 12:54

GoogleCodeExporter commented 8 years ago
Hi guys!

I fixed it! In version 3.5.0 BETA5

I've changed the line 722:

FROM: cursor.hborder = parseFloat(cursor.outerHeight() - cursor.innerHeight());

TO: 
cursor.hborder = parseFloat(cursor.outerHeight() - cursor.innerHeight() + 
self.opt.railpadding['top'] + self.opt.railpadding['bottom']); 

And in line 1756:

FROM: self.cursor.css({height:self.cursorheight,top:self.scroll.y}); 

TO: self.cursor.css({height:self.cursorheight,top:self.scroll.y + 
self.opt.railpadding['top']});

I hope this helps.

Original comment by jeanp...@gmail.com on 9 Sep 2013 at 8:40

GoogleCodeExporter commented 8 years ago
in jquery.nicescroll 3.5.6 
the padding top and bottom for vertical scroll are ignored, 

Original comment by mantavis...@gmail.com on 15 Oct 2014 at 3:13

GoogleCodeExporter commented 8 years ago
Comment #3 worked for me, thank you !

[https://code.google.com/p/jquery-nicescroll/issues/detail?id=24#c3]

Original comment by Alin3...@gmail.com on 16 Oct 2014 at 1:38