jQuery-slimScroll
jQuery-slimScroll copied to clipboard
bottom event not firing consistently
not sure why... the top event is firing as expected. I'm using the latest version of jQuery 3.1.1
my page has a fixed top menu using the Bootstrap 3.3.x Fixed Header template. I have to use padding-top on the body element like so:
body { padding-top: 70px; }
Would that be having an effect on detecting and triggering 'bottom' event ?
Thanks for your help...
Hi I have the same issue
@t2k did you find a solution to this?
Please, let me know
Thanks
Hi
Both events are fired correctly with jquery version 1.1.9
The demo is with that version
http://rocha.la/jQuery-slimScroll
at the line after comment
// calculate actual scroll amount
it should be
percentScroll = parseInt(bar.css('top')) / (parseInt(me.outerHeight()) - parseInt(bar.outerHeight()));
without parseInt
, the height is in float value and percentScroll
never reaches 1 (means bottom).
@linhntaim Thank you for your solution. It worked!
@linhntaim Your solution did work. I think jQuery version does have something to do with it. It was working fine until I updated the jQuery in my project.
Worked for me as well! Thanks! (I've also updated JQuery, so it definitely about it). Would be great to update the lib. A lot of opened pull request is in.
@linhntaim The parseInt solution worked perfectly but i found another issue with event not reaching to bottom. The bottom event gets fire when i try to scroll from my mouse scroll button but when i try do by dragging the scrollbar with my mouse it doesn't fire any idea why this is happening?
@linhntaim The parseInt solution worked perfectly but I found another issue with the event not reaching to the bottom. The bottom event gets fire when I try to scroll from my mouse scroll button but when I try to do by dragging the scrollbar with my mouse it doesn't fire any idea why this is happening?
I found the solution to this after debugging the slimscroll.js. In function scrollContent we have a variable i.e var maxTop = me.outerHeight() - bar.outerHeight();
this also needed be update with parseInt as below var maxTop = parseInt(me.outerHeight()) - parseInt(bar.outerHeight());
This has solved my event firing issue with scrollbar drag