Grow your CSS skills. Land your dream job.

Apply class to parent if child div contains class

  • # January 21, 2013 at 5:01 pm

    Okay I got it to work in the CMS! (I had to change some settings) I’m trying to use this same method to change a background color, but it doesn’t seem to work. At first I just thought that it was the CMS but I also can’t get it to work in JS fiddle.

    http://jsfiddle.net/eak819/jmFe7/

    Is something incorrect?

    $(‘.lof-inner div.hot’).siblings(‘.lof-row’).addClass(‘blackred’);

    When sibling .lof-row is found it will add .blackred then CSS takes over from there. I’ve also tried to use the .closest selector but no joy.

    # January 24, 2013 at 3:23 pm

    I fixed it, thanks guys!

Viewing 2 posts - 31 through 32 (of 32 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".