Jump to content
GreenSock

bdrtsky

Get stagger index in advanced doesn't work

Recommended Posts

Hey bdrtsky,

 

I think your thread title is a bit misleading as you are not doing much in your code other than setting up an event listener.

 

What you want to achieve is a bit more involved than you might thing. You need to figure out which element the mouse is over before you can trigger the tween.

 

For that, you can't really use the 'mouseenter' because it will not bubble/propagate, you have to use 'mouseover' instead and work out which of the elements you are over. Bellow is a way you can achieve your desired result.

 

See the Pen KEZmeQ by dipscom (@dipscom) on CodePen

 

 

 

  • Like 3
Link to comment
Share on other sites

@Dipscom's cleverness is 'staggering'.

 

I think he should stop working for clients and just hang out on the forum all day. ;)

  • Like 2
Link to comment
Share on other sites

2 minutes ago, PointC said:

I think he should stop working for clients and just hang out on the forum all day. ;)

 

Let's figure out how I can feed a child now plus (in the future) a second one and I shall subscribe to your suggestion.

  • Like 2
  • Haha 1
Link to comment
Share on other sites

Food, shelter, clothing — all will be unnecessary when your code helps us achieve the singularity. You can then transfer your consciousness into the Matrix and monitor the forum forever. (something Blake has already done) :ph34r:

 

Actually, I'm just trying to prod you along so you can battle your way up a few positions on the Leaderboard. ?

  • Haha 2
Link to comment
Share on other sites

Well, I'm here, picking up whatever questions you and the other lot manage to let slip...

 

1 minute ago, PointC said:

Actually, I'm just trying to prod you along so you can battle your way up a few positions on the Leaderboard. ?

 

Give us a few likes for the sake of it, then. :D

 

ps: For someone without a child, you got a fine arsenal of dad-jokes.

 

  • Like 2
  • Haha 1
Link to comment
Share on other sites

Cool, thanks! Still I was hoping there could be a way automagically solve this, for the case, where I can't edit data attributes...

Link to comment
Share on other sites

Just now, bdrtsky said:

Cool, thanks! Still I was hoping there could be a wait automagically solve this, for the case, where I can't edit data attributes...

 

There are other ways to figure out which element is over, the data attributes was just a simple, quick, way to achieve it.

  • Like 2
Link to comment
Share on other sites

3 minutes ago, Dipscom said:

Give us a few likes for the sake of it, then. :D

 

Done. You've been like bombed. You can wire the usual amount to my PayPal account.

 

3 minutes ago, Dipscom said:

ps: For someone without a child, you got a fine arsenal of dad-jokes.

 

Children or not, with age comes wisdom, forgetfulness, aching joints and corniness.

  • Haha 2
Link to comment
Share on other sites

2 minutes ago, PointC said:

Children or not, with age comes wisdom, forgetfulness, aching joints and corniness.

 

I must not have aged well enough. I only seem to be getting 3 out of the 4 bonuses.

  • Haha 1
Link to comment
Share on other sites

Here's one other option that only uses JS: 

 

 

I'm enjoying all the back-and-forth too, @PointC and @Dipscom :) I definitely have plenty of "dad jokes" that cause an immediate eye-roll from my 15-year-old son in particular. My 17-year-old just ignores them or smirks a little. @Dipscom, they will just come natural after about 5-8 years of parenting...or maybe just when you hit a certain age. I dunno. 

  • Like 4
Link to comment
Share on other sites

I appreciate your answers, since I already wanted to add event listener to every child :) This is much much more elegant solution, very enlightening. I should probably take advice above to spend more time on forum :D 

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