ここではChromeで問題なく動作するmy CodePenです。FirefoxでのCSSトランジションとアニメーションの組み合わせ
.animated-box {
width: 100px;
height: 100px;
margin: 10px auto;
background: black;
border-radius: 50px;
transition-duration: 0.2s;
}
.animated-box:hover {
border-radius: 18px;
animation-name: test;
animation-duration: 0.7s;
animation-delay: 0.2s;
}
@keyframes test {
0% {
border-radius: 18px;
}
12% {
border-radius: 15px;
}
41% {
border-radius: 21px;
}
70% {
border-radius: 16px;
}
100% {
border-radius: 18px;
}
}
<div class="animated-box"></div>
しかし、Firefoxで問題があります。 CSSトランジションとCSSアニメーションの両方のプロパティがある場合、アニメーションは再生されません。 どのように動作させるには?
.animated-box
セレクタに「出力」アニメーションを作成すると、このアニメーションはページ読み込み後に再生されるため、間違った解決策です。
ここにはFirefoxとChromeの結果を比較したa videoがあります。
さて、あなたの '遷移delay'はそれがありますなぜ私は取得しないすべての事をしないのですか? ...あなたは、遷移とアニメーションの両方をしたい場合は、まず、すべてのコードを置く前に、私たちは、なぜそれを動作させるために言うことができる – LGSon
それはまた、Firefoxで動作します..どのFirefoxのバージョンは動作しません? –
円から四角への移行後に「バウンス」効果を出すために使用される 'transition-delay' – RNR