Home › Forums › CSS › [How]When hovering on a child div the main div changes color. › Re: [How]When hovering on a child div the main div changes color.
March 25, 2013 at 6:19 am
#129603
CrocoDillon
Participant
Yes, on that site they use JS (didn’t check if it is jQuery, but probably it is) to add classes like `path-ruby` to the container.
Here is how it can be done using jQuery: http://codepen.io/CrocoDillon/pen/tqEfh
@Krish1980, you’re removing all other classes from the parent div like `.parent`. That’s why I like jQuery so much, functions like `addClass` and `removeClass` automatically keep the other classes :)