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 I distinguish what scrolling event type has acquired (onWheel,onClick,onScroll) FullPage.js with autoScrolling={true}? #4110

Closed
ramimazloum871 opened this issue Nov 24, 2020 · 5 comments

Comments

@ramimazloum871
Copy link

How can I distinguish if the scrolling event has acquired because of wheel scroll event, by drag and move or by clicking the circle on FullPage.js with autoScrolling={true}?

I want to make an animation when you use the wheel to change the slide.

I want to use silentMoveTo(section, slide) if you click on the circle.

something like this

onleave(origin, destination, direction) { if (event.onWheel) { console.log("wheel went") return true } if (event.onScroll) { console.log("onScroll ") return true } if (event.onClick) { console.log("onClick") return true } }

@alvarotrigo
Copy link
Owner

Thanks! Good point!
I'll mark it as a possible enhancement for future versions! 👍

@ramimazloum871
Copy link
Author

You have mentioned in StackOverflow that I can create my own click events or use my own global variables to achieve that.

I tried to use the window.addEventListener to capture the event I want but that not possible when using autoScrolling.
Can you provide me with an example of what you mean? pier in mind I'm using React.

@alvarotrigo
Copy link
Owner

I tried to use the window.addEventListener to capture the event I want but that not possible when using autoScrolling.

Why wouldn't that be possible. There's no problem on doing that.

@ramimazloum871
Copy link
Author

yeah, I have been doing it wrong all the time ^_^, now it's working thanks

@alvarotrigo
Copy link
Owner

Fixed on v4! 👍

There's a new param in all callbacks called trigger.
https://github.com/alvarotrigo/fullPage.js#callbacks

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