evolution1003 Posted September 25, 2022 Share Posted September 25, 2022 hey, i would like to do this simple animation but instead of y: -200 i would like to use the top screen how can i do this? See the Pen MWGOeRv by Titan10 (@Titan10) on CodePen Link to comment Share on other sites More sharing options...
Solution mvaneijgen Posted September 25, 2022 Solution Share Posted September 25, 2022 You'll need to calculate that, you can use the property .offsetTop on the element. Important if you do this you want to also set the transformOrigin, so that it is aligned to the top edge of the box. Check the comments in the code for more details. Any particular reason you've used a keyframe? It's just one tween, so I've set it up as a normal tween, but the keyframe code it also still there if you really need it. See the Pen eYregZB by mvaneijgen (@mvaneijgen) on CodePen 2 Link to comment Share on other sites More sharing options...
evolution1003 Posted September 26, 2022 Author Share Posted September 26, 2022 thank you !!! there's no particular reason for that 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