Jump to content
Search Community

element to the Top

evolution1003 test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

  • Solution

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

 

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...