You have to stop myStop
function in a specific condition, when rotation degrees is at starting position.(当旋转角度处于起始位置时,必须在特定条件下停止myStop
功能。)
function myStop(img) { console.log(img); deg /= 1.1; console.log(deg); if (deg.toFixed(1) < 0.1) { return; } img.css('transform', 'rotate(' + deg + 'deg)'); if(keepStopping) { setTimeout(myStop, 30, img); } }
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…