Jump to content
Search Community

DAGMAN

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by DAGMAN

  1. Hey Jack, Nope it was merely not understanding it For now I'll load the minified and in the future I'll know to load the gsap.js file! Brilliant thank you and also to Rodrigo for the input.
  2. Hi Rodrigo Thank you for the quick response! So yeah, I downloaded the GSAP ZIP file and plucked the gsap-core.js file out of the esm folder. I then imported that script via another script import { gsap } from '../vendor/greensock/gsap-core.js'; /* ... */ console.log(gsap); console.log(arrowBase); // Animate In tm = gsap.timeline(); tm.to(arrowBase, { duration: 0.25, top: 100, height: 50 }); I console logged out stuff to show they were nodes and objects etc. But no matter what I do it throws the error. I figured could it be a CSS plugin thing but I read here https://greensock.com/docs/v3/GSAP/CorePlugins/CSSPlugin#faq that it is part of gsap core and loaded automatically. So all I have is below which is imported into my other module. I've applied the most basic use of gsap timeline but I'm still getting the error I've added a gsap basic test which replicates the same resultsgsap test.zip Now just to say, after initially writing this question I managed to get the old way working by importing the cloudflare Tweenmax https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js But that was globally and I wanted to do it the modular way. Also the way you suggested works but again I'm trying to figure out why the module way isn't working :-S thank you again
  3. Hey all, We have a website which pulls in gsap the old way and generally works. But seeing as our future sites are going to be all module based I'm trying to pull gsap in and get it working but I seem to be getting the following error below. import { gsap } from '../vendor/greensock/gsap-core.js'; /* ... */ console.log(gsap); console.log(arrowBase); // Animate In tm = gsap.timeline(); tm.to(arrowBase, { duration: 0.25, top: 100, height: 50 }); Obviously there is more code but I get the following errors. I was wondering if it could be the CSSPlugin but on inspection of the documentation it states it is built into the core now. I added the console logs so you can see the results of gsap and arrowBase. The actual version of gsap-core.js is version 3.11.1 Is the above a classic miss-understanding with new people trying to use it. I've used it a few years ago but I'm back to newby again right now. I'm not sure if I can make a code pen example unless you can emulate the exact setup of importing a module..? But I'm thinking what I've given is enough for somebody to notice the obvious and give it to me straight I've found if I do the following it doesn't error but I really need to set a timeline var for this as it states in the documentation as well. gsap.timeline(arrowBase, { duration: 0.25, top: 100, height: 50 }); Thank you in advance Duncan
×
×
  • Create New...