Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can BetterScroll disable scrolling without affecting click events when click is enabled? #1376

Open
lzg2486 opened this issue Nov 6, 2024 · 3 comments

Comments

@lzg2486
Copy link

lzg2486 commented Nov 6, 2024

No description provided.

@lzg2486
Copy link
Author

lzg2486 commented Nov 6, 2024

I currently use disable() and enable() to control the turning off and on of better scroll scrolling, but when disable() is used to turn it off, the corresponding click event will also become invalid.
The expected effect is that better scroll scrolling can be manually controlled to turn on and off, regardless of whether it is turned on or off, without affecting its click events

@shimangdian
Copy link

so am i, did you have any help?

@lzg2486
Copy link
Author

lzg2486 commented Dec 9, 2024

Cannot be turned off using the disable() method, otherwise all functions of BetterScroll will be turned off. Instead, an intermediate state is used to manage 'isMaxHeightReached'. When the scrolling height reaches a certain height, the scrolling is paused through scrollTo (0,0,0) and stop(), and the value of 'isMaxHeightReached' is changed to manage scrolling and pausing scrolling through this intermediate value. You can give it a try.

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

No branches or pull requests

2 participants