向各位请教一下。
轮播广告中,点击上一张的按钮如何实现无缝?
我现在从第一张到最后一张会经过中间几张图片,如何实现无缝?
$('.shanGou_prev a').click(function(e){
e.preventDefault();//取消默认事件
shanGou_this.index--;//序列号减减
shanGou_this.index=shanGou_this.index<0?shanGou_this.num-2:shanGou_this.index;//判断如果序列号小于零,则让序列号等于li的个数减2(在li末尾我添加了第一个LI,使右按钮变成无缝连接)
shanGou_this.move(shanGou_this.index);//调用move函数
});
move(i){
if(i<0){
$('.shanGou_slider').stop(true).animate({left:-(this.$sg_slider.length-1)*shanGou_this.LIWIDTH+'px'});//如果序列号小于0,left: ul的(length-1)*宽度.
}
}
以上是我的js代码,请问应该如何改,使左侧按钮变成无缝的?