scottnj Posted April 3, 2022 Posted April 3, 2022 I have an intro animation timeline that works great. The onComplete of this timeline then calls a function that uses Flip.from() to animate my header and brand from fullscreen to a normal top nav bar. After I use Flip.getState() I remove my ".big" class from my header, then use Flip.from(). When I remove the ".big" class from my header, it causes a jump in the animation. Is there a better way for me to accomplish this? I can't figure out how to get rid of the jump. See the Pen GRyObez by scottnj (@scottnj) on CodePen.
GreenSock Posted April 3, 2022 Posted April 3, 2022 Is this what you wanted? See the Pen wvppvyO?editors=0010 by GreenSock (@GreenSock) on CodePen. When you're using things like display: flex, don't forget to set absolute: true (watch the video that explains it - that's not a Flip thing...it's just that the browser doesn't honor width/height values when you use display: flex). And Flip doesn't analyze every possible CSS property, otherwise it would hurt performance so if you're animating things other than position and size you need to add those to the "props" list so that Flip knows to record/animate them (fontSize in your case). Does that clear things up? 1
scottnj Posted April 3, 2022 Author Posted April 3, 2022 Excellent! That makes sense and fixed the animation. Adding absolute: true made the header cover the main content area. Adding main to the Flip.from() seems to fix that issue. Thanks! See the Pen JjMMdjq by scottnj (@scottnj) on CodePen. 1
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