私は、キーフレームを使用してマウスオーバー時にdivの無限大を作成し、縮小します。 下のリンクからわかるように、親ボックスはサイズを大きくし、子divは拡大縮小を開始します。 親divがスケールダウンする前に、マウスのアウトにしたいと思います。子divは、通常のサイズにスムーズに戻ります。 ここでわかるように、滑らかさを伴わずに突然元のサイズに戻ります。CSSを使用してmouseoutで元のサイズに縮尺を変更
私のキーフレーム:
@keyframes imageZoom {
0% { transform: scale(1); }
50% { transform: scale(1.24); }
100% { transform: scale(1);}
}
@-moz-keyframes imageZoom {
0% { -moz-transform: scale(1);}
50% { -moz-transform: scale(1.24); }
100% { -moz-transform: scale(1); }
}
@-webkit-keyframes imageZoom {
0% { -webkit-transform: scale(1); }
50% {-webkit-transform: scale(1.24); }
100% { -webkit-transform: scale(1); }
}
@-ms-keyframes imageZoom {
0% { -ms-transform: scale(1); }
50% { -ms-transform: scale(1.24); }
100% { -ms-transform: scale(1); }
}
子のdivのスタイル:
#myFeaturedItems:hover article {
animation: imageZoom linear 50s;
animation-iteration-count: infinite;
-webkit-animation: imageZoom linear 50s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-delay: 1.5s;
animation-delay: 1.5s;
}
#myFeaturedItems article {
background-image: url('https://images.unsplash.com/photo-1447688812233-3dbfff862778?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&s=01b98cd0603404826ec5df6d9ef46dfc');
background-position: center center;
background-size: cover;
display: block;
height: 100%;
width: 100%;
}
私のデモへのリンク:http://emanuelezenoni.com/dev/test/
どうもありがとう!