我正在使用此代码http://jsbin.com/uqovih/381/edit 而且我需要知道是否还有计时器滑动
<script type="text/javascript">
var $gal = $('#divslider'),
$sli = $('#divinslider'),
$box = $('div',$sli),
W = $gal.width(), // 500
N = $box.length, // 3
C = 0; // a counter
$sli.width(W*N);
$('#prev, #next').click(function(){
C = (this.id=='next' ? ++C : --C) <0 ? N-1 : C%N;
$sli.start().animate({left: -C*W },800);
});
答案 0 :(得分:0)
function slide(){
C = ++C <0 ? N-1 : C%N;
$sli.stop().animate({left: -C*W },800);
}
setInterval(slide,3000); // update the timer depending upon your need.