我的本意
当我hover
超过一个li
时,#featuredThumbs li
我想交换div
下#productText
我怎样才能做到这一点?我想为 和 添加一个活动li
状态div
。我还希望它在页面加载时自动启动。
JS
$("#featuredThumbs li").hover( function() {
$(".active").removeClass("active");
$(this).addClass("active");
});
HTML
<div id="container">
<h2>Lorem ipsum!</h2>
<div id="featuredProducts">
<div id="productText">
<div id="autoText" class="products">
<h3>Auto Insurance</h3>
<p>orem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea</p>
</div>
<!-- eo : products -->
<div id="homeText" class="products">
<h3>Auto Insurance</h3>
<p>orem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea</p>
</div>
<!-- eo : products -->
<div id="commercialText" class="products">
<h3>Auto Insurance</h3>
<p>orem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea</p>
</div>
<!-- eo : products -->
<div id="lifeText" class="products">
<h3>Auto Insurance</h3>
<p>orem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea</p>
</div>
<!-- eo : products -->
</div>
<!-- eo: productText -->
<ul id="featuredThumbs">
<li id="autoProd"></li>
<li id="homeProd"></li>
<li id="commercialProd"></li>
<li id="lifeProd"></li>
</ul>
</div>
<!-- eo : featuredProducts -->
</div>