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

Proposal of wheelSensitivity for desktops #202

Open
dantart opened this issue May 31, 2020 · 2 comments
Open

Proposal of wheelSensitivity for desktops #202

dantart opened this issue May 31, 2020 · 2 comments

Comments

@dantart
Copy link

dantart commented May 31, 2020

Hi!

As far as I checked using the plugin, and checking also in the source code, it seems touchSensitivity works just in "touch" handler (it make sense because of the name XD), therefore in mobile/tablets.

Is there any way to play with this parameter also in desktops? or have a wheelSensitivity one ?

Thank you

@dantart dantart changed the title touchSensitivity does not work in desktop Proposal of wheelSensitivity for desktops May 31, 2020
@dantart
Copy link
Author

dantart commented May 31, 2020

I know it's not the same "concept" as sensitivity of the touch, but it works for me ...

I created a "wheelSensitivity" option to express the "force" of the scroll once you reach the bottom or the top of the scrollable element.

Then:

        function isScrolled(type, scrollable){
            if(type === 'top'){
                return !scrollable.scrollTop() && getAverage(scrollings, 70) > options.wheelSensitivity;
            }else if(type === 'bottom'){
                return scrollable.scrollTop() + 1 + scrollable.innerHeight() >= scrollable[0].scrollHeight && getAverage(scrollings, 70) > options.wheelSensitivity;
            }
        }

this works for reduce the "sensitivity" when wheeling in desktop.

Just an idea ;-)

@alvarotrigo
Copy link
Owner

Thanks, I'll mark it as a possible enhancement 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants