以下代码循环遍历精灵图像,每秒移动 -120,但由于某种原因,它从 0 跳转到 -120,然后跳转到 120 而不是 -240
thismarginLeft = $this.css("margin-left").replace(/[^0-9]/g,'');
if(thismarginLeft < -360 || thismarginLeft == 0){
thismarginLeft = thismarginLeft - 120;
if(thismarginLeft < -360){
thismarginLeft = 0;
}
}