Jump to content


staggerFrom only animating first image in sequence

Recommended Posts



My apologies if I haven't done this correctly. Literally my first time on here and presenting a pen.


So my issue is this...I am building my webpage, and the portfolio page opens with the navigation bar at the top and social media bar at the bottom (irrelevant for this demo because these animations work), tweening from opacity 0, then my 14 portfolio buttons staggering in from left one by one to array in a 3 x 5 formation:


var $Nav = $('Nav'),

$socialmedia = $('socialmedia'),
$imggal = $('imggal'),
tl = new TimelineMax();
.from("#Nav", 2, {opacity:0})
.from("#socialmedia", 2, {opacity:0}, 0.5)
.staggerFrom("#imggal", 0.5, {x:-2000, ease:Power1.easeOut}, 0.2);
However, when I test this timeline, only the top left, or first img, actually animates. The rest are sitting there proudly visible, lazily doing nothing at all. It kind of says that the tween is working, but why the other 13 img boxes aren't is lost on me.
I hope this makes sense. Happy to give more details if necessary.



See the Pen rrVgPo by BurntMatch (@BurntMatch) on CodePen

Link to comment
Share on other sites

Hi and welcome to the forums.



Thanks for the simplified demo.


The problem here is that IDs are supposed to be unique and applied to only ONE element. You have the id of #imggal on every image and this is bad.

You should switch to a class. Or you can just select every img in your gallery using "#gallery img"

TweenMax.staggerFrom("#gallery img", 0.5, {x:-2000, ease:Power1.easeOut}, 0.2);



I noticed your demo wasn't loading TweenMax, you need to go to the JS tab settings (little gear icon) and add it



  • Like 1
Link to comment
Share on other sites

Carl = Superhero.


Thanks heaps for that Carl. Really very appreciative. That was a bit of a brain fart on my behalf. Like I said, new to the game. But should've been on top of that. I swapped everything over from Class to ID and it works a treat now.




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.