; i++){ $bannerList.eq(i).css("zIndex",bannerLength-i); focusBubble.append("
  • "); } focusBubble.find("li").eq(0).addClass("current"); var bubbleLength=focusBubble.find("li").length; focusBubble.css({ "width":bubbleLength*22, "marginLeft":-bubbleLength*11 });//初始化 focusBubble.on("click","li",function(){ $(this).addClass("current").siblings().removeClass("current"); _index=$(this).index(); changeImg(_index); });//点击轮换 nextBnt.on("click",function(){ _index++ if(_index>bannerLength-1){ _index=0; } changeImg(_index); });//下一张 prevBnt.on("click",function(){ _index-- if(_index<0){ _index=bannerLength-1; } changeImg(_index); });//上一张 function changeImg(_index){ $bannerList.eq(_index).fadeIn(250); $bannerList.eq(_index).siblings().fadeOut(200); focusBubble.find("li").removeClass("current"); focusBubble.find("li").eq(_index).addClass("current"); clearInterval(_timer); _timer=setInterval(function(){nextBnt.on('click')},5000); }//切换主函数 _timer=setInterval(function(){nextBnt.on('click')},5000); }(); })

    News