Search the Community
Showing results for tags 'event handling'.
-
Hey, Hopefully a simple one for someone who's been using gsap more than a day I'm just trying to cut down on the number of gsap.to animations I'm calling, but I'm unable to get any animation happening when passing evt.currentTarget as it's always null - I also tried evt.target & event.target.id to no avail document.getElementById("menuitem0").addEventListener("mouseenter", hoverIn); function hoverIn(evt) { console.log(evt); gsap.to(evt.currentTarget, { scale: 1.5, color: "white", duration: 0.3, paused: true, ease: "power2.inOut" }); } I saw you can do something like this let hover1 = gsap.to(menuitem1, { scale: 1.5, color: "white", duration: 0.3, paused: true, ease: "power2.inOut" }); document.getElementById("menuitem1").addEventListener("mouseenter", () => hover1.play()); document.getElementById("menuitem1").addEventListener("mouseleave", () => hover1.reverse()); but need to removeEventListener, so needed to break the function out Any help is much appreciated
-
When I want to add an event handler to an svg element how can I select it? With DOM. Yes. With jquery? With ... d3.js? Is there any incompatibillities with d3.js?
- 4 replies
-
- event handling
- with other js libraries
-
(and 1 more)
Tagged with: