我知道已经有人问过类似的问题,但我的例子完全不同,无法让它发挥作用。
示例:http: //jsfiddle.net/xhUZd/
<ul id="list">
<li>
<div class="box1">
<span class="one"></span>
<span class="two"></span>
<span class="three"></span>
</div>
<div class="box2">
<span class="one"></span>
<span class="two"></span>
<span class="three"></span>
</div>
</li>
<li>
<div class="box1">
<span class="one"></span>
<span class="two"></span>
<span class="three"></span>
</div>
<div class="box2">
<span class="one"></span>
<span class="two"></span>
<span class="three"></span>
</div>
</li>
</ul>
使命:
悬停时
来自“Box2”的 span.one - 将“bg1”类添加到来自“Box1”的 span.one
span.two from "Box2" - 将类 "bg2" 添加到 span.two 从 "Box1"
span.three from "Box2" - 添加 CLASS "bg3" 到 span.three from "Box1"
这必须单独在每个“li”中工作。
请帮忙!