Jump to content
Search Community

Uncaught ReferenceError: Draggable is not defined

samsam test
Moderator Tag

Go to solution Solved by PointC,

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'm getting this error when attempting to implement Draggable. I'm confused because I am able to do some of the functions that are shown in the 'Get Started' section i.e 

var obj = {myProp:0};TweenLite.to(obj, 2, {myProp:100}); 

I added a codepen - very simple representation of what I am doing. 


Any idea what's going wrong here? 



See the Pen EyWjLO by anon (@anon) on CodePen

Link to comment
Share on other sites

  • Solution

Hi samsam  :)


Welcome to the GS forums.


Your pen isn't loading the Draggable plugin. It might be easiest for you to fork this GreenSock pen:


See the Pen OPqpRJ by GreenSock (@GreenSock) on CodePen


It loads everything including the member plugins so you can give them a test drive. Just an FYI - you don't need the head elements or body tag on CodePen - it takes care of that for you and the JavaScript should go in the JS panel down below.


Hopefully that gets you started. 


Happy tweening and welcome aboard.


  • Like 4
Link to comment
Share on other sites

Hi pointc thanks for helping me with this. I didn't know that the Draggable plugin had a separate <script> to load, I thought it was included as part of TweenMax. I've got it working now. Thanks again!

Link to comment
Share on other sites

If you want to use Draggable, you need to load it. 

You just listed all the bonus plugins (none of which have anything to do with Draggable, although ThrowPropsPlugin does unlock the momentum-based flicking feature in Draggable). 
Does that help? So basically, you can load Draggable and TweenMax and you'll be able to do almost anything :) (Draggable requires TweenMax or TweenLite/CSSPlugin)
Link to comment
Share on other sites

  • 2 years later...

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