Jump to content
Search Community

How do I make animation responsive?

Passionate
Moderator Tag

Go to solution Solved by ZachSaucier,

Recommended Posts

Posted

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? 

Posted

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

 

  • Like 1
  • Solution
Posted

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.

  • Like 1
  • Thanks 1
Posted
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!

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...