回転させている要素にhoverした時に、任意の角度へスムーズに角度を変更することは不可能でしょうか。
何卒よろしくお願いいたします。
html
1<div class="box"></div>
css
1.box { 2 width: 50px; 3 height: 50px; 4 background: #333; 5 animation: move 5s linear infinite forwards; 6} 7.box:hover { 8 animation: move_45 1s linear forwards; 9} 10@keyframes move { 11 from {transform: rotate(0deg);} 12 to {transform: rotate(360deg);} 13} 14@keyframes move_45 { 15 to {transform: rotate(45deg);} 16} 17
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/06/26 00:26