Share Posted March 13, 2019 I want to start stagger from element under cursor. This doesn't seems to work See the Pen oVpZmQ by bdrtsky (@bdrtsky) on CodePen See the Pen oVpZmQ by bdrtsky (@bdrtsky) on CodePen Link to comment Share on other sites More sharing options...
Share Posted March 13, 2019 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 3 Link to comment Share on other sites More sharing options...
Share Posted March 13, 2019 @Dipscom's cleverness is 'staggering'. I think he should stop working for clients and just hang out on the forum all day. 2 Link to comment Share on other sites More sharing options...
Share Posted March 13, 2019 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. 2 1 Link to comment Share on other sites More sharing options...
Share Posted March 13, 2019 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) Actually, I'm just trying to prod you along so you can battle your way up a few positions on the Leaderboard. ? 2 Link to comment Share on other sites More sharing options...
Share Posted March 13, 2019 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. ps: For someone without a child, you got a fine arsenal of dad-jokes. 2 1 Link to comment Share on other sites More sharing options...
Author Share Posted March 13, 2019 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 More sharing options...
Share Posted March 13, 2019 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. 2 Link to comment Share on other sites More sharing options...
Share Posted March 13, 2019 3 minutes ago, Dipscom said: Give us a few likes for the sake of it, then. 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. 2 Link to comment Share on other sites More sharing options...
Share Posted March 13, 2019 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. 1 Link to comment Share on other sites More sharing options...
Share Posted March 13, 2019 Here's one other option that only uses JS: See the Pen 6798296ffccb43483ef8be76978d0c75?editors=0010 by GreenSock (@GreenSock) on CodePen 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. 4 Link to comment Share on other sites More sharing options...
Author Share Posted March 13, 2019 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 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now