Open
Conversation
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
This was referenced Apr 13, 2017
send options and delta to whileScrolling callback
Author
|
I updated the first comment with details about the second patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 !