Jump to content
Search Community

Can't find variable: TimelineMax

marcfolio 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

I have the following code:

window.onload = function() {
var tl = new TimelineMax();
tl.to(document.getElementById("exit-button"), tt, {autoAlpha:1, ease:Power3.easeInOut})
}


I'm loading tweenmax from the CDN. 

 

And on my localhost everything works as planned, but when I upload to the clients server I think they have some other scripts/ assets that are throwing the window.onload off. 

 

What can I do to avoid the error: "Can't find variable: TimelineMax"? 

 

HELP?!

Link to comment
Share on other sites

Hmm, really tough to troubleshoot without seeing what's happening. Can you share a link to the server?

 

Carl, here's the link:

https://familysearch.org/worldsrecords?listEx

 

You'll probably have to check the EXPERIMENTS > wwieV2Ex check box and refresh the page. 

 

Here's the error. I think there's some conflicting going on with the client's JS and TweenMax? 

 

Error: module root needs to be defined for resolving URLs

resolveFile — inject_0.5.2-34a5e9dae81403fd2abd05358f239360.js:1:42631
process — inject_0.5.2-34a5e9dae81403fd2abd05358f239360.js:1:38559
define — inject_0.5.2-34a5e9dae81403fd2abd05358f239360.js:1:37763
(anonymous function) — inject_0.5.2-34a5e9dae81403fd2abd05358f239360.js:1:188
check — TweenMax.min.js:16:19716
q — TweenMax.min.js:16:19954
_gsDefine — TweenMax.min.js:16:20004
_class — TweenMax.min.js:16:20068
(anonymous function) — TweenMax.min.js:16:20137
global code — TweenMax.min.js:17:13523

 

Link to comment
Share on other sites

Gosh, that definitely sounds like an issue with other JS on that site (unrelated to GSAP). We really try to keep this forum focused on GSAP-specific questions/issues. If you have a reduced test case in codepen or jsfiddle that indicates it's a problem with GSAP, we'd be happy to take a peek. We definitely want to make sure things on our end are working perfectly. But yeah, those errors sure sound like some sort of module loading problem or something along those lines.

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