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 to set offsets and targets with useScroll? #39

Open
simpel opened this issue Apr 20, 2023 · 0 comments
Open

How to set offsets and targets with useScroll? #39

simpel opened this issue Apr 20, 2023 · 0 comments

Comments

@simpel
Copy link

simpel commented Apr 20, 2023

Hello!

How can I use the useScroll hook provided to detect when a element is in view. I.e how can I use this package to achieve the same thing as you can do with framer motion useScroll

const { scrollYProgress } = useScroll({
   target: ref,
   offset: ['start end', '0.4 0.9']
});

I'd like to apply a target and offsets so I can animate elements based on their position in the viewport

@simpel simpel changed the title How to How to set offsets and targets with useScroll? Apr 20, 2023
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

1 participant