私はCSSアニメーションを使用して、ページが読み込まれたときにdivをスライドします。 (Chrome)アニメーション塗りつぶしモードの後、CSS変換とホバー上のトランジションが機能しません:forwards
私はanimation-fill-mode: forwards;
を使用して新しい状態を維持します。
そこから、transform:scale(2);
を使用し、1秒以上の遷移を持つ単純なホバーアニメーションを作りたいと思います。
マイCSS:
.box{
background-color:blue;
width:100px;
height:100px;
margin: 0 auto;
animation-name: test;
animation-duration: 3s;
animation-fill-mode: forwards;
transition: 1s ease;
}
@keyframes test{
0% {
transform: translate(-200px)
}
100% {
transform: translate(0px);
}
}
.box:hover{
transform: scale(2);
}
私はそれが動作border-radius
のようなホバー上の簡単な変更、使用している場合:どういうわけか
.box{
transition: border-radius 0.25s ease;
}
.box:hover{
border-radius: 100%;
}
を初期CSSアニメーションは、変換に干渉しています/要素のホバー状態の遷移。
私はanimation-fill-mode
transform
動作しますが、ないトランジション削除するにはホバーを変更する場合:
.box:hover{
animation-fill-mode:none;
border-radius: 100%;
}
任意のアイデア?