Skip to content

Commit c6eb8e0

Browse files
committed
fix, when scrollbar height equal parent height, auto hide
1 parent f9cca71 commit c6eb8e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jquery.slimscroll.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,9 @@
374374
bar.css({ height: barHeight + 'px' });
375375

376376
// hide scrollbar if content is not long enough
377-
var display = barHeight == me.outerHeight() ? 'none' : 'block';
377+
var display = me.outerHeight() - barHeight <= 1 ? 'none' : 'block';
378378
bar.css({ display: display });
379+
if (o.railVisible) { rail.css({ display: display }); }
379380
}
380381

381382
function showBar()
@@ -400,7 +401,7 @@
400401
lastScroll = percentScroll;
401402

402403
// show only when required
403-
if(barHeight >= me.outerHeight()) {
404+
if(barHeight >= me.outerHeight() - 1) {
404405
//allow window scroll
405406
releaseScroll = true;
406407
return;

0 commit comments

Comments
 (0)