Passionate Posted October 17, 2020 Posted October 17, 2020 I'm trying to make animation responsive upon screen resize. I tried THIS but didn't work. How can I make element go from 0 to 100 of screen size all the time?
mikel Posted October 17, 2020 Posted October 17, 2020 Hey @Passionate, Welcome to the GreenSock Forum. Here you can see an example based on a bezier animation. See the Pen poveLRo by mikeK (@mikeK) on CodePen. Happy tweening ... Mikel 1
Solution ZachSaucier Posted October 17, 2020 Solution Posted October 17, 2020 Hey Passionate and welcome. There are several ways you could set this up. One way is to invalidate your tween and then play it again on resize. Make sure to use a functional value for properties you want to refresh though. See the Pen bGepQMq?editors=0010 by GreenSock (@GreenSock) on CodePen. We highly recommend using CodePen to host demos over W3Schools because CodePen is much easier to customize and for the code. We also recommend using other learning resources over W3Schools because W3Schools at times has incorrect or outdated information. 1 1
Passionate Posted October 18, 2020 Author Posted October 18, 2020 11 hours ago, ZachSaucier said: c 11 hours ago, ZachSaucier said: Hey Passionate and welcome. There are several ways you could set this up. One way is to invalidate your tween and then play it again on resize. Make sure to use a functional value for properties you want to refresh though. We highly recommend using CodePen to host demos over W3Schools because CodePen is much easier to customize and for the code. We also recommend using other learning resources over W3Schools because W3Schools at times has incorrect or outdated information. Thanks!
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