当涉及到过渡和动画时,我正试图围绕 CSS3 进行思考。我有一些盒子,当鼠标悬停在盒子上时,我希望标题和描述能够动画化。
为了让它工作,我想我必须在包装元素的 :hover 事件被触发时定义动画。我想我只是没有在我的 CSS 中正确执行这个。
.feature-box, .feature-box-title, .feature-box-image, .feature-box-desc {
-webkit-transition: all 300ms linear;
-moz-transition: all 300ms linear;
-o-transition: all 300ms linear;
-ms-transition: all 300ms linear;
transition: all 300ms linear;
}
.feature-box:hover .feature-box-title {
-webkit-animation: moveFromRight 300ms ease;
-moz-animation: moveFromRight 300ms ease;
-ms-animation: moveFromRight 300ms ease;
}
.feature-box:hover .feature-box-desc {
-webkit-animation: moveFromBottom 500ms ease;
-moz-animation: moveFromBottom 500ms ease;
-ms-animation: moveFromBottom 500ms ease;
}