每隔5秒显示下一页内容:
var num = 0; var $content = $(".div"); var loopDiv = function(){ var len = $content.find("div").length; $content.find("div").hide(); $content.find("div").eq(num).show(); num = num + 1 == len ? 0 : num + 1; t = setTimeout(function(){ loopDiv(); },5000); }; loopDiv(); $content.hover(function(){ learInterval(t); }); $content.mouseleave(function(){ loopDiv(); });
时间: 2024-10-06 10:36:19