Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Thales Ribeiro

Animating other links, not selected one

Recommended Posts

Hi there, 

I'm animating a few thumbnails for a website, you can check out a quick version i adapted for codepen, so you can see what i'm trying to archive.

 

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

 

What i'd like to add to this, would be an effect on the other thumbnails apart from the one that the user is hovering.

 

For instance, you rollOver on the thumbnail 1, the thumbnail 1 gets its rollover animation alongside with the other fading out for example.

 

I put my animation inside this function, so i'm not sure how to target the other elements.

$(".thumb a").each(function(index, element){}

Cheers,

Thales

Link to post
Share on other sites

Using jQuery you could find the siblings() of the parent of the rolled-over ".thumb a" which would give you every thumb except the one you are rolling over

 

http://codepen.io/GreenSock/pen/erzqC

 

Likely other ways too.

  • Like 2
Link to post
Share on other sites

Thanks Carl, 

That's exactly what i needed.

 

Now i just tried to change the code putting the animation for the siblings as a variable that i can play and reverse in the function so it's easier to update the animation.

 

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

 

I'm not sure what the right syntax might be, 

 

i've tried these as well:

var myTween:TweenLite = new TweenLite(mc, 1, {x:100}); 
TweenLite.to(mc, 1, {x:100}); 
var myTween:TweenLite = TweenLite.to(mc, 1, {x:100});
 
Cheers,
Thales
Link to post
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.

×