From 4f49b0fa7f082bdaef8f8207f0bae9a0eaa878fb Mon Sep 17 00:00:00 2001 From: etnassoft Date: Thu, 21 Mar 2013 11:21:20 +0100 Subject: [PATCH] Fix bug with mouse wheel --- src/perfect-scrollbar.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index be056dd..a41dd38 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -90,6 +90,10 @@ $this.scrollTop(0); } + if(scrollbar_y_top >= container_height - scrollbar_y_height) { + scrollbar_y_top = container_height - scrollbar_y_height; + } + $scrollbar_x.css({left: scrollbar_x_left + $this.scrollLeft(), bottom: scrollbar_x_bottom - $this.scrollTop(), width: scrollbar_x_width}); $scrollbar_y.css({top: scrollbar_y_top + $this.scrollTop(), right: scrollbar_y_right - $this.scrollLeft(), height: scrollbar_y_height}); };