これは速度の既知のバグであるとジュリアンは、彼がそれを固定されますが、私の知る限りでは全く知られているリリース日が存在しないと言う:
https://github.com/julianshapiro/velocity/issues/453(負の値が回転を回しては、
時計回りのループが実際に機能するので、反時計回りの無限ループを素早く回避するには、バグが修正されるまで次のような方法があります。
フィドル:https://jsfiddle.net/znyLtfaf/2/
HTML:
<div class="gear gearRight">rotate right</div>
<div class="gear gearLeft">rotate left</div>
CSS:
.gear {
width: 100px;
height: 100px;
position: absolute;
background: red;
}
.gearRight {
top: 100px;
left: 100px;
}
.gearLeft {
top: 300px;
left: 100px;
}
JS:
$('.gearRight').velocity({ rotateZ: "+=360" }, { duration: 5000, easing: "linear", loop: true});
loopMeLeft();
function loopMeLeft() {
$('.gearLeft').velocity({ rotateZ: "-=360" }, { duration: 5000, easing: "linear", complete: loopMeLeft});
}
そして、ここではスピードアップして、もう少し複雑な例であり、歯車の減速dしかし、縁の周りに少し荒いですが、一般的なアイデアはそこにあります。
フィドル:https://jsfiddle.net/AtheistP3ace/znyLtfaf/4/
誰もが任意のアイデアを持っていますか? –