私は現在のアニメーションのフレームから最初の位置に戻したいと思います。 ここでは、このコードでは単純なcss3キーフレームアニメーションとそのホバー上での作業を記述しました。マウスが出ている間、私はこの要素をアニメーションで最初の位置に戻したいと思っています。css3のキーフレームアニメーションをマウスの現在のフレームから元に戻すにはどうすればいいですか?
// html
------------------------------------
<div class="wrapper">
<div class="test"></div>
</div>
のCss
.wrapper {width: 300px; height: 400px; position: relative;}
.test {width:40px; height: 40px; background-color: #0c6; border-radius: 40px; position: absolute; top:100px; left: 100px;}
.wrapper:hover .test{
animation-name:testin ; -webkit-animation-name:testin;
animation-duration: 2s; -webkit-animation-duration: 2s;
animation-timing-function: ease; -webkit-animation-timing-function:ease;
animation-iteration-count: infinite; -webkit-animation-iteration-count: infinite;
animation-direction: normal; -webkit-animation-direction: normal;
animation-delay: 0s; -webkit-animation-delay:0s;
animation-play-state: running; -webkit-animation-play-state: running;
animation-fill-mode: forwards; -webkit-animation-fill-mode: forwards;
}
@keyframes testin {
0%{top:100px; left:100px;}
20%{top:150px; left:150px;}
40%{top:200px; left:50px;}
60%{top:250px; left:150px;}
80%{top:300px; left:50px;}
100%{top:350px; left:150px;}
}
@-webkit-keyframes testin {
0%{top:100px; left:100px;}
20%{top:150px; left:150px;}
40%{top:200px; left:50px;}
60%{top:250px; left:150px;}
80%{top:300px; left:50px;}
100%{top:350px; left:150px;}
}
効果のこの種の任意のジャバスクリプト/ jqueryのヘルプまたはライブラリがある場合教えてください。
ありがとうございました