老师提供的源代码里,这一段是什么意思?视频里面好像没有讲?
var go = function (){ if ( (speed > 0 && parseInt(list.style.left) < left) || (speed < 0 && parseInt(list.style.left) > left)) { list.style.left = parseInt(list.style.left) + speed + 'px'; setTimeout(go, inteval); } else { list.style.left = left + 'px'; if(left>-200){ list.style.left = -600 * len + 'px'; } if(left<(-600 * len)) { list.style.left = '-600px'; } animated = false; } }
中的
if(left>-200){
list.style.left = -600 * len + 'px';
}
if(left<(-600 * len)) {
list.style.left = '-600px';
}