我的網頁上有五個div(#art #fashion,#self,#nightlife,#community)。 現在,當您將鼠標懸停在它們上面時,它們會將頁面內容加載到另一個容器div(#flyer)中。通過jquery循環顯示圖片
我希望傳單內容每5秒循環一次。
所以,而不必鼠標懸停這5個div,它應該自動去。
確實有道理嗎?
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#art").mouseover(function(){ $('#flyer').load($(this).attr("href") + ' #flyer'); return false; });
$("#fashion").mouseover(function(){ $('#flyer').load($(this).attr("href") + ' #flyer'); return false; });
$("#self").mouseover(function(){ $('#flyer').load($(this).attr("href") + ' #flyer'); return false; });
$("#nightlife").mouseover(function(){ $('#flyer').load($(this).attr("href") + ' #flyer'); return false; });
$("#community").mouseover(function(){ $('#flyer').load($(this).attr("href") + ' #flyer'); return false; });
});
</script>
我覺得有一個「循環」插件,但我該如何去執行它?顯然,我的jquery技能是有限的。 此外,我忘了提及每個傳單鏈接到一個不同的頁面。 所以當它通過每個傳單循環時,鏈接仍然應該是活動的。 – Pico 2010-02-26 19:41:26
我想我應該明確一點,我需要循環DIV而不僅僅是圖像。致歉,請致電 。 – Pico 2010-02-26 19:46:25