【发布时间】:2013-09-16 17:35:41
【问题描述】:
以下代码循环遍历精灵图像,每秒移动 -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;
}
}
【问题讨论】:
-
请在您的问题中包含所有相关代码。