$(function(){ $("#focus").focu({//调用 evt: "click", subscript: true,//是否启用下标 button: false,//是否启用左右按钮 autotime: 5000 }); }) $(function (){ var _obj = $(".scroller"); var oul = _obj.find("ul"); var oli = oul.find("li"); var osize = oli.size(); var h = oli.height(); var ospeed = 500; var idx = null; var timer = null; $(".btndown").click(onext); _obj.hover(function(){ clearinterval(timer); clearinterval(timer1); },function(){ timer = setinterval(function(){ onext(); },ospeed * 5); timer1 = setinterval(function(){ $(".btndown img").animate({top:30},function(){ $(this).css({"top":-30,"opacity":0,"filter":"alpha(opacity=0)"}); $(this).animate({top:0,opacity:1},function(){ $(this).css({"filter":"alpha(opacity=100)"}); }); }); },1500) }).trigger("mouseleave"); function onext(){ idx++; if(idx>=osize){ idx = 0; } scroller(idx) }; function scroller(idx){ if(idx>0){ oul.stop().animate({top:-idx * h},ospeed); }else{ oul.stop().animate({top:-idx * h},250); } }; });