效果图:实现代码: 复制代码 代码如下: Jquery 自动轮播效果 <BR>.spanhide{display: none;} <BR>#top a:hover{color: red;} <BR> 1 2 3 4 5 <BR>$(function(){ <BR>var i = 0; <BR>var f = 0; <BR>var t; <BR>var tops = $("#top a"); <BR>var tl = tops.length; <BR>var bodys = $("#tbody span"); <BR>tops.mouseover(function(){ <BR>i = $.inArray(this,tops); <BR>bodys.hide().eq(i).show(); <BR>i++; <BR>i = i>=tl?0:i; <BR>if (f == 1) { <BR>t = setTimeout(mmover,2000); <BR>} <BR>else{ <BR>stop(); <BR>} <BR>f = 0; <BR>}); <BR>bodys.mouseover(function(){ <BR>stop(); <BR>}); <BR>bodys.mouseout(function(){ <BR>t = setTimeout(mmover,2000); <BR>}); <BR>tops.mouseout(function(){ <BR>t = setTimeout(mmover,2000); <BR>}); <BR>mmover(); <BR>function stop(){ <BR>clearTimeout(t); <BR>} <BR>function mmover(){ <BR>f = 1; <BR>tops.eq(i).mouseover(); <BR>} <BR>}); <BR>