Jump to content
Search Community

easing Back

Sami Barasi 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

Switching the order is unfortunately not a solution, because it's not my site. What ever that script does, it shouldn't matter while loading the greensock lib especially if I set the GreenSockGlobals option. I want to use Greensock for animating banners. For this I need to be sure not to interfere with scripts of any hosting sites and I also don't have the control of when or where my banners are loaded.

Link to comment
Share on other sites

GSAP was built to be compatible with several different types of component systems like requirejs, AMD, and node. In order to do that, it looks for a "define()" function that's an industry standard for AMD/CommonJS systems and if it finds one (and as long as it has an "amd" property defined), GSAP will register/define its classes through that function. In your case, it looks like you had a script that created a define function and also had a "Back" class already registered, so when GSAP tried to register its "Back", an error was thrown. So it's not really a bug in GSAP or anything - it's just a consequence of another script having the define() function and already registering a "Back" module. 

 

To avoid the problem, you can simply reassign the "define" variable to null right before GSAP loads, and then assign it back to what it was after GSAP loads. Here's a corrected pen: 

http://codepen.io/anon/pen/WvjqBQ

 

Does that help?

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