Jump to content
GreenSock

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

Animating Elements Loaded Through Javascript

Recommended Posts

I'm having a bit of trouble animating elements that are loaded through JavaScript.

 

Specifically, I was using Jason Mayes Twitter Post Fetcher to load tweets into my page.  However, when I try to animate the username, tweets, or any other elements that it loads, I am unable to.

 

I am sure my timeline and tweens are working properly, because when I add in static elements, they target the proper elements.  Is there anyway to target elements loaded via JS?

See the Pen EPXQOG by anon (@anon) on CodePen

Link to comment
Share on other sites

Hi Fakebook  :)

 

you should to define Tweens after appending ( when the new dom objects is ready ) , seems there's " customCallback " in that config object , and you can use that .

 

See the Pen Ioype by jasonmayes (@jasonmayes) on CodePen

  • Like 3
Link to comment
Share on other sites

Hi Fakebook  :)

 

you should to define Tweens after appending ( when the new dom objects is ready ) , seems there's " customCallback " in that config object , and you can use that .

 

See the Pen Ioype by jasonmayes (@jasonmayes) on CodePen

 

Thanks Diaco.  Your idea works, but I was hoping there would be a way to do this without callbacks within plugins.  I wasn't sure if there was something within GSAP or maybe a smarter way to do this with jQuery or JS.

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