Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Need to know if I'm using jquery.gsap plugin

Go to solution Solved by GreenSock,

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

After the jquery cdn I added the cdn for TweenMax.min.js then the cdn for jquery.gsap.min.js.  The code works but I don't know if the animation is caused by jquery.animate or gsap plugin.  How can I tell?

See the Pen GoEyqB by jimeast (@jimeast) on CodePen

Link to comment
Share on other sites

  • Solution

A few options come to mind:

  1. Add a property that only GSAP can do, like "rotation" or "x" or "y". If it works, you know it ain't jQuery doing it ;)
  2. After you create a tween for a particular element, you could use TweenLite.getTweensOf("#yourElement") and see if it returns anything (well, see if the array is empty). That returns all of the registered tweens for that element that haven't been garbage collected. Again, if you get results, you know GSAP is working. 
  3. Along the same lines, you could try calling TweenLite.killTweensOf("#yourElement") while your stuff is tweening. If it stops animating, you know GSAP is doing the animations. If jQuery is controlling it, then killing tweens through TweenLite won't have any effect. 

In your demo, I added an "x:2000" to the tween and it worked fine, so there's your proof :) 

  • Like 2
Link to comment
Share on other sites

I found an answer, I just tacked on a TweemMax  command and it worked so the animations are powered by GreenSock!

Link to comment
Share on other sites

For the record, I'd strongly recommend using the GSAP API directly instead of relying on the jQuery plugin. I think you'll find that it's much more empowering and flexible. Plus it's slightly faster. 


Happy tweening!

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.