Jump to content
Search Community

Vanilla JS TimelineMax Produces Console Logs But Doesn't Play

tetreault 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

Hello, 

 

I have a websocket project I'm working on. When a user joins the site they get a div created for them with an icon as background image. I have a function that runs on DOMContentLoaded that creates fake user divs and wanted to build a timeline of animation moving them around via the X and Y properties in TweenLite.

 

I am really stuck scratching my head - my TimelineMax produces console logs on Update() but nothinggggg moves.

 

I could really appreciate a second pair of eyes! I've distilled the function in question down to a codepen. 

 

Thank you in advance!

 

Stephen

See the Pen ygEjgL by tetreault (@tetreault) on CodePen

Link to comment
Share on other sites

  • Solution

HI tetreault :)

 

Welcome to the GreenSock forum.

 

You're only loading TweenLite so you'll also need the CSS Plugin:

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.1/plugins/CSSPlugin.min.js"></script>

If you were loading TweenMax, that plugin would be loaded by default. TweenMax includes:

  • TweenLite
  • TweenMax
  • TimelineLite
  • TimelineMax
  • CSSPlugin
  • AttrPlugin
  • RoundPropsPlugin
  • DirectionalRotationPlugin
  • BezierPlugin
  • EasePack

That should get things working for you.

 

Happy tweening.

:)

  • Like 2
Link to comment
Share on other sites

OMG. Face-freaking-palm. I've used Greensock for a while now and usually use TweenMax. I'm not sure why I decided to use TweenLite this time, but I was unaware you needed the CSSPlugin. Must have really not been paying attention. 

 

That resolves it, thanks!

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