Jump to content
Search Community

Draggable is not defined - Draggable is loaded

BigMattKush 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 keep getting Draggable not defined error. but I see it is being loaded like the other files. No codepen here.

 

Works in my sandbox - https://animation-sandbox.zentropy.us/duffs-cake-mix/

 

Does not load here. https://duffscakemix.zentropy.us/

 

When I moved the page over to the same environment it will not load Draggable. it loads everything else. I am 100% sure the file is being loaded in the header. Does this need to be loaded elswhere?

image.png.8b6ea2419db1191c85fe02a789db5d17.png

 

image.thumb.png.8a5131bfd784ab9c3e4990270eeeaf7b.png

 

 

Link to comment
Share on other sites

It's a bit difficult to decipher because there's soooo much going on in that live page, but I suspect the problem has to do with this line: 

var oldGS=window.GreenSockGlobals,oldGSQueue=window._gsQueue,oldGSDefine=window._gsDefine;window._gsDefine=null;delete(window._gsDefine);var gwGS=window.GreenSockGlobals={};

 

That's basically forcing any GreenSock files after that to load into a special object instead of the global namespace. I'm not exactly sure why you're doing that.

 

Also, it looks like you've got a bunch of redundant GreenSock files being loaded. A super old version of TweenMax (1.11.2), plus the latest version, plus TweenLite (which is already in both of those). You just need one TweenMax.min.js file, plus Draggable and ThrowPropsPlugin.
 

  • Like 1
Link to comment
Share on other sites

ok, that makes sense, It is a wordpress site, and the files are being enqueued via the standard wordpress method. I cleaned it up and still no dice. It is a wordpress environment, and I dont know where the code you posted came from. How can I force the files to be loaded onto the global container. I have never had this issue before.

Link to comment
Share on other sites

Thanks for everyones help. with a fresh set of eyes(in addition to your assistance) I was able to track down the issue. I am a wordpress/Magento dev so I was a bit puzzled by the eroneous scripts pointed out to me in this thread, so I started there.

 

In wordpress my colleague who built the page had a plugin called layerslider7 enabled. it did not seem to be used. This plugin was not only loading the following script, but the ancient version of TweenMax.

var oldGS=window.GreenSockGlobals,oldGSQueue=window._gsQueue,oldGSDefine=window._gsDefine;window._gsDefine=null;delete(window._gsDefine);var gwGS=window.GreenSockGlobals={};

 

 

I found this declaration in the middle of a bunch of LayerSLider7 scripts. I disabled the plugin and Boom! back in business.

 

Radial animation cake dial is up here --- https://duffscakemix.zentropy.us/

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