Jump to content
Search Community

Uncaught ReferenceError: TimelineMax is not defined

ltscribble 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've tried this with scripts from a cdn and locally but neither works. It looks like a path issue but I can't see where I'm going wrong.

 

<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/jRespond.min.js"></script>
<script src="js/greensock-js/src/uncompressed/TimelineMax.js"></script>
<script src="js/main.js"></script>
 
In the dev tools I can see that the scripts are being loaded.
 
In the main.js
 
$(document).ready(function() {
    var tl = new TimelineMax({paused: true});
});
 
in the console:
 
Uncaught ReferenceError: TimelineMax is not defined
 
Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

You also need to add TweenLite and the CSSPlugin. Without TweenLite, TimelineMax won't work. Basically the core of GSAP (the tweening engine so to speak) is contained in TweenLite. And if you want to animate a DOM element (which is the most common scenario) you'll need the CSSPlugin to do so.

<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/jRespond.min.js"></script>
<script src="js/greensock-js/src/uncompressed/TweenLite.js"></script>
<script src="js/greensock-js/src/uncompressed/plugins/CSSPlugin.js"></script>
<script src="js/greensock-js/src/uncompressed/TimelineMax.js"></script>
<script src="js/main.js"></script>

Another possibility is to include TweenMax.js which contains TweenLite, TimelineLite, TimelineMax, CSSPlugin, BezierPlugin, Directional Rotation Plugin, Attr Plugin, Round Props Plugin and the Ease Pack:

<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/jRespond.min.js"></script>
<script src="js/greensock-js/src/uncompressed/TweenMax.js"></script>
<script src="js/main.js"></script>

Rodrigo.

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