我有一個HTML的結構是這樣的:jQuery的懸停問題
<ul id="carousel" class="jcarousel-skin-photos">
<li><a href="images/content/featuredPhoto.jpg"><img src="images/content/featuredPhoto.jpg" alt="Lorem Ipsum Dolor Sit Amet..." /></a></li>
<li><a href="images/content/featuredPhoto.jpg"><img src="images/content/featuredPhoto.jpg" alt="Lorem Ipsum Dolor Sit Amet..." /></a></li>
<li><a href="images/content/featuredPhoto.jpg"><img src="images/content/featuredPhoto.jpg" alt="Lorem Ipsum Dolor Sit Amet..." /></a></li>
<li><a href="images/content/featuredPhoto.jpg"><img src="images/content/featuredPhoto.jpg" alt="Lorem Ipsum Dolor Sit Amet..." /></a></li>
<li><a href="images/content/featuredPhoto.jpg"><img src="images/content/featuredPhoto.jpg" alt="Lorem Ipsum Dolor Sit Amet..." /></a></li>
<li><a href="images/content/featuredPhoto.jpg"><img src="images/content/featuredPhoto.jpg" alt="Lorem Ipsum Dolor Sit Amet..." /></a></li>
<li><a href="images/content/featuredPhoto.jpg"><img src="images/content/featuredPhoto.jpg" alt="Lorem Ipsum Dolor Sit Amet..." /></a></li>
<li><a href="images/content/featuredPhoto.jpg"><img src="images/content/featuredPhoto.jpg" alt="Lorem Ipsum Dolor Sit Amet..." /></a></li>
<li><a href="images/content/featuredPhoto.jpg"><img src="images/content/featuredPhoto.jpg" alt="Lorem Ipsum Dolor Sit Amet..." /></a></li>
<li><a href="images/content/featuredPhoto.jpg"><img src="images/content/featuredPhoto.jpg" alt="Lorem Ipsum Dolor Sit Amet..." /></a></li>
</ul>
<a href="javascript:;" id="zoom">Yakınlaştır</a>
還有一點jQuery的代碼片段淡入/淡出效果:
$('ul#carousel li a').hover(
function() {
$('a#zoom').fadeIn('fast');
},
function() {
$('a#zoom').fadeOut('slow');
});
在我想告訴a#zoom
元素時結束徘徊在ul#carousel li a
元素上。但是淡入淡出效果存在一些奇怪的現象。
This is my work page。您可以在線查看。
那麼我該如何解決這個問題呢?
對我而言看起來不錯 – marcgg 2009-11-25 14:00:17
只是對您的選擇器發表評論:您不需要指定「ul#carousel」或「#zoom」;相反,直接使用「#carousel」和「#zoom」 – 2009-11-25 14:00:41
問題是 - 當懸停在li上並顯示縮放圖標並懸停在圖標上時它會消失? – 2009-11-25 14:01:09