From e0aa42f6a119db15a4ee654fa9eae8dad4149160 Mon Sep 17 00:00:00 2001 From: Caio Kawasaki Date: Tue, 1 Sep 2015 11:39:39 -0300 Subject: [PATCH] Bug when resizing the window corrected --- src/jquery.smoothwheel.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/jquery.smoothwheel.js b/src/jquery.smoothwheel.js index 9624f4a..1f2829d 100644 --- a/src/jquery.smoothwheel.js +++ b/src/jquery.smoothwheel.js @@ -131,7 +131,10 @@ targetY = oldY = container.get(0).scrollTop; currentY = -targetY; - minScrollTop = container.get(0).clientHeight - container.get(0).scrollHeight; + $(window).resize(function(){ + minScrollTop = container.get(0).clientHeight - container.get(0).scrollHeight; + }); + if(options.onRender){ onRenderCallback = options.onRender; } @@ -150,4 +153,4 @@ }; -})(jQuery); \ No newline at end of file +})(jQuery);