【发布时间】:2011-11-10 21:21:36
【问题描述】:
我希望将鼠标悬停在子导航中的列表项上,激活页面上该类别中所有项目的类(不仅仅是父元素或兄弟元素)。有任何想法吗?这是我的意思的一个例子:
<style>
img.BLUE {border:1px solid #FFF}
</style>
<ul id="subnav">
<li id="BLUE">Blue</li> <!--When hovering these...-->
<li id="PINK">Pink</li>
<li id="YELLOW">Yellow</li>
</ul>
<!--other stuff here-->
<img class="BLUE" href="image.jpg"> <!--it applies the border to this and any other img.blue on the page-->
<img class="PINK" href="image1.jpg">
<img class="YELLOW" href="image2.jpg">
【问题讨论】:
标签: javascript jquery css hover