Skip to content

Add some support for infinite scroll#527

Open
bugdanov wants to merge 4 commits intomalihu:masterfrom
doxel:master
Open

Add some support for infinite scroll#527
bugdanov wants to merge 4 commits intomalihu:masterfrom
doxel:master

Conversation

@bugdanov
Copy link

@bugdanov bugdanov commented Apr 13, 2017

Hi ! Thanks for the plugin !

When scroll pos is 0 or reached the limit, mousewheel event is not propagated and whilescrolling callback is not called.

One way or another I need to know the mousewheel delta in this case, to trigger content loading for infinite scroll (eg when I start by displaying some item range at the middle of the data set and I need to scroll up)

The first patch c3ae494 trigger a mcswheel event in order to achieve this, but you may implement it the way you like.. or maybe there was already another way ?..

The second patch 8efb2a6 fix another issue where I had to compare the current scrollPos with the previous on in the whileScrolling callback to determine the direction, but it was rather a hack and the method was not error prone. Passing the delta to the whileScrolling callback is a much better way (the delta could be normalized if somebody cares)... Being here, passing "options" in the same object costs nothing and may be useful for #521 or another issue.

Cheers !

In one way or another, I need to receive mousewheel delta to trigger loading content for infinite scroll, even when the scroll pos reached limits.
Update jquery.mCustomScrollbar.js
@bugdanov
Copy link
Author

I updated the first comment with details about the second patch

@bugdanov bugdanov changed the title Need to receive mousewheel event delta when scrollpos is 0 or reached the limit Add some support for infinite scroll Apr 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants