div id="slot1" で単一のクラス .active を切り替えたい。
div には 2 つの子 div があります。.active が div に適用されていない場合、1 つの child1 が黄色、child2 が緑色になります。$("#slot").addClass("active") のようなことを適用すると、child1 が青になり、child2 が赤になります。
親の「スロット」で .active を切り替えると状態が切り替わるように、「子」の css を作成するにはどうすればよいですか
.normal{}
.active{}
.a{color:yellow;}
.b{color:green;}
.a [when .active is applied to my daddy] {color:blue;}
.b [when .active is applied to my daddy] {color:red;}
<div id="slot1" class="normal">
<div class="a">normal I'm yellow, with active I'm blue</div>
<div class="b">normal I'm green, with active I'm red</div>
</div>
<div id="slot2" class="normal active">
<div class="a">normal I'm yellow, with active I'm blue</div>
<div class="b">normal I'm green, with active I'm red</div>
</div>