I am trying to create a social sharing box. Here is my code so far…
When I hover on one of the icons I want the fill color of the rest of the icons changed to the color present in the data-color
atrribute.
I tried to do something like this element.style.fill = element.dataset.color
in javascript but it changes the color of all the icons. Is there any way to select all the icons except the hovered one?
Edit
I made it work
What I did is created an array containing all of the icons and during mouse hover event I filtered the array to exclude the hovered item.
Check the codepen link above to see working code.