svg animate - Beginning and pausing SVG animations on hover - Stack Overflow I would like to animate the gears on the following SVG when the user hovers over it. That is, when the mouse enters, both gears begin rotating where they left off. When the mouse leaves, the gears. Stack Overflow About Products For Teams
javascript How can I animate an svg icon on hover? Stack Overflow
2 Answers Sorted by: 6 With a SMIL animation, this is possible without any scripting. It morphs the cubic bezier path from straight to curved and back. The animation is triggered by mouseover and mouseout events over a transparent rectangle that sits on top of the line.
SVG animation resets on hover CSSTricks CSSTricks
SVG can be set as a background image just like PNG, JPG, or whatever other graphics format. At this point, you've sort of given up on being able to change the fill. One possibility, which I'd argue isn't a particularly good one, is to have two versions of every icon, in the respective colors, and swap between them: