Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

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.

#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 :)