rochal / jQuery-slimScroll

small jQuery plugin that transforms any div into a scrollable area with a nice scrollbar. Demo and more:
http://rocha.la/jQuery-slimScroll
2.23k stars 928 forks source link

bottom event not firing consistently #274

Open t2k opened 7 years ago

t2k commented 7 years ago

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...

juansebahler commented 7 years ago

Hi I have the same issue

@t2k did you find a solution to this?

Please, let me know

Thanks

juansebahler commented 7 years ago

Hi

Both events are fired correctly with jquery version 1.1.9

The demo is with that version

http://rocha.la/jQuery-slimScroll

linhntaim commented 7 years ago

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).

Maxith commented 6 years ago

@linhntaim Thank you for your solution. It worked!

aamirMasood commented 6 years ago

@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.

yrikturash commented 6 years ago

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.

DevVIN commented 4 years ago

@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?

DevVIN commented 4 years ago

@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