Jump to content
Search Community

The function isn't working on CodePen while working on-premises.

Shah Sadikov test
Moderator Tag

Go to solution Solved by PointC,

Recommended Posts

Hello,

I am new to GSAP and getting experience by doing smaller projects. I have attached one such example. The GSAP function I have used in the CodePen example works as expected on-premises but not on CodePen (I left a comment above that function separated by //==== ). I  also tried to use the function without "an arrow" but just as "function(word)"; however,  still not getting it to work.

 

I look forward to reading your feedback. Thank you in advance!

Shah

See the Pen LYewOov?editors=0110 by shahsadikov (@shahsadikov) on CodePen

Link to comment
Share on other sites

Dear Mr. Craig @PointC,

 

Thank you very much for your quick response with the solution, and for the welcome, it's much appreciated! If I may ask a follow up question: why is the TextPlugin registered while the other, RoughEase, isn't? Because the other plugin is working without it being registered.

 

Thank you again!

Shah

Link to comment
Share on other sites

Just to clarify, the plugins will TRY to automatically register themselves but that can only happen if GSAP is loaded as a global first. So in a CodePen environment, you're simply loading the gsap.min.js file and as long as that happens first, the subsequently-loaded plugins won't technically need to be registered but we always recommend that you do it anyway because if you move to a modules-based environment with a build tool or something, things aren't really global anymore. 

 

So in summary, Blake is exactly correct about the fact that you should just get in the habit of registering plugins to avoid any potential problems. I simply wanted to explain why it may still work sometimes if you don't register. 

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