1
私はorbitアニメーションをトリガするクラス.orbitを持っています。クラスを削除して回転を止めます。要素が元の位置にリセットされます。CSS回転アニメーションが停止します
要素をそのままにして、トラック内で回転アニメーションを停止する方法はありますか?
現在、ポジションを取得して設定していますが、完璧ではありません。
https://jsfiddle.net/f4hnz2va/2/
#errordot{
position:absolute;
top:0;
left:0;
width:50px;
height:50px;
background:red;
border-radius:50%;
font-size:40px;
}
#errorsun{
width:200px;
height:200px;
position:absolute;
top:50px;
left:50px;
}
.orbit {
-webkit-animation-iteration-count:infinite;
-webkit-animation-timing-function:linear;
-webkit-animation-name:orbit;
-webkit-animation-duration:5s;
}
@-webkit-keyframes orbit {
from { -webkit-transform:rotate(0deg) }
to { -webkit-transform:rotate(360deg) }
}
@-moz-keyframes orbit {
from { -moz-transform:rotate(0deg) }
to { -moz-transform:rotate(360deg) }
}
私の更新フィドル:https://jsfiddle.net/f4hnz2va/3/ – user193661