Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
samsam

Uncaught ReferenceError: Draggable is not defined

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 post
Share on other sites

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

×