我的页面上有五个 div(#art #fashion、#self、#nightlife、#community)。现在,当您将鼠标悬停在它们上时,它们会将页面内容加载到另一个容器 div (#flyer) 中。
我希望传单内容每 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>