Jump to content
Search Community

Most efficient way to create mobile and desktop animations?

kkyang test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

so for a site I'm working on. the mobile will essentially be a basic slider while the desktop has a different slide functionality. 

 

Currently I have the desktop slider complete and trying to figure out the best way to go about this. 

 

These are the two options I thought of

  1. Clone the html with jquery clone and create a new mobile timeline version. show hide with css.
  2. Create and destroy timelines on the same html based on browser size.

 

Which is the better option or is there a better option out there?

 

Thanks!

 

Link to comment
Share on other sites

Hi kkyang  :)

 

We've had a few good discussions about responsive animations. Some involve calculating new positions while others kill() the timeline completely. I think these threads could help you decide what to do:

 

https://greensock.com/forums/topic/15214-animating-object-to-center-of-window-scale-based-on-window-size-percentage/

https://greensock.com/forums/topic/15758-destroy-current-timeline-initiate-new-one-on-window-resize/

https://greensock.com/forums/topic/14892-reposition-animation-on-screen-resize/

 

Hopefully those get you started in the right direction.

 

Happy tweening.

:)

  • Like 3
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...