CSS3 ブラウザーでのホバー時に GIF 画像をアニメーション化 (フリップ) したいのですが、CSS3 以外のブラウザーでは背景色を変更するだけです。
コードを使用して CSS3 Flip アニメーションを実現できます
.imageselector:hover {
-webkit-animation-name: rotate;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function: linear;
-moz-animation-name: rotate;
-moz-animation-duration: 2s;
-moz-animation-iteration-count: 1;
-moz-animation-timing-function: linear;
}
@-webkit-keyframes rotate {
from {-webkit-transform: rotateX(0deg);}
to {-webkit-transform: rotateX(360deg);}
}
@-moz-keyframes rotate {
from {-moz-transform: rotateX(0deg);}
to {-moz-transform: rotateX(360deg);}
}
を使用した背景の変更
.imageselector:hover { background:#FFF999; }
両方を組み合わせて、CSS3 をサポートするブラウザーではアニメーションのみを表示し、CSS3 以外のブラウザーでは背景色のみを変更するようにします。