Jump to content
Search Community

Need simplest possible example of drag.

jimeast 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

Since my example code is so simple I thought it might be best to just lay it out here rather than use codepen.

When I run the following code in firefox I get no error message but it doesn't drag either, in Chrome I get 2 errors:

Uncaught SyntaxError: Unexpected token <
dragTest.html:20 Uncaught ReferenceError: Draggable is not defined(anonymous function) @ dragTest.html:20
Here is my code:
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>drag test</title>
<style type="text/css">
#smallBox {
position: absolute;
width: 100px;
height: 100px;
background-color: red;
<div id="smallBox"></div>
<script src="gs/min/utils/"></script>
Link to comment
Share on other sites

  • Solution

hmmm... I suppose we shouldn't overlook the obvious here - I don't see TweenMax being loaded in the code you posted.


If you load Draggable without TweenMax, you will still get the draggable is not defined error.


Could TweenMax be missing?



Edit: you can also use TweenLite, but will need the CSSPlugin too. 

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