Jump to content
GreenSock

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

Vanilla JS TimelineMax Produces Console Logs But Doesn't Play

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

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

It happens to all of us. :)

 

Glad to hear it's all working for you now. Happy tweening.

  • Like 1
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.
×