Jump to content
Search Community

When to use jQuery... when to use GSAP?

joe_temp 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, I'm trying to build a slideshow that uses GSAP. But I'm wondering... do I do EVERYTHING with GSAP? One thing I'm trying to use right now is jQuery's addClass. The class I'm adding basically makes something visible. Can I continue to use that to show my slide? Or do I need to use GSAP to get the performance boost?

Link to comment
Share on other sites

Hi, I think the answer to the question is different for every case. It depends on the type of animation, what browsers you need to support, does saving few extra kilobytes worth dropping GSAP etc. In my workflow I use jQuery for selection engine, to add/remove events and to modify the DOM. For all my animations I use GSAP. Basically adding and removing a class can simply show/hide things, and if you set transition in the CSS, in modern browsers it will be animated. But it will look ugly on old browsers, and also you don't have so much control over what's happening for more advanced animations. Note that you will get the GSAP performance boost only if you actually animate things with jQuery animate() method and include GSAP and jquery.gsap.js plugin, or use TweenMax/Lite instead of jQuery animate. 

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