js图片滚动的问题,第一张图片第一次马上滚到第二张,没有停顿,第二次滚动就能正常,求大神解决!
js代码:function getIndex(v){ for(var i=0; i < target.length; i++){ if (target[i] == v) return i; }}function rechange(loop){ var id = ✀✀+ target[loop]; $(✀#.current✀).removeClass(✀current✀); $(✀#✀+ id).addClass(✀current✀);}function auto(){ index++; if (index > 2){ index = 0; } rechange(index); slideImage(index); timer = window.setTimeout(auto, offset);}