TimTh Posted January 12, 2022 Share Posted January 12, 2022 Hi - When using the ScrollTo plugin I'd like to set the offset using vh instead of px, but offsetY seems to take only numeric values in pixels. offsetY: "5vh" or even offsetY: "20px" don't seem to work. Am I missing something, or if px is the only unit allowed with ScrollTo, is there a way to accomplish what I'm trying to do with a regular tween, without the ScrollTo plugin? Apologies if the answer is obvious/basic, I'm new to GSAP and didn't see anything on the forums or with a general google search. Thanks for any advice! Link to comment Share on other sites More sharing options...
Solution OSUblake Posted January 12, 2022 Solution Share Posted January 12, 2022 Welcome to the forums @TimTh It looks like it only works with numerical values, but if you wanted to do 5vh, it would be the same as 0.05 * innerHeight. 3 Link to comment Share on other sites More sharing options...
TimTh Posted January 12, 2022 Author Share Posted January 12, 2022 Awesome, thank you very much! It's nice to know I wasn't missing something syntactically and even better to have a workaround. Much appreciated! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now