Reverse CSS animation on :hover
Instead of using reverse
I just created another animation which is the reverse of your current one.
I did it likes this: http://codepen.io/anon/pen/zoeWLO
div { -webkit-animation-fill-mode: forwards; animation-duration: 2s; animation-name: a; background-color: #a00; display: inline-block; padding: 50px;}
div:hover { -webkit-animation-fill-mode: forwards; animation-duration: 2s; animation-name: ra;}
@keyframes a { 0% { padding: 50px; } 100% { padding: 100px 200px; }}
@keyframes ra{ 0% { padding: 100px 200px; } 100% { padding: 50px; }}
<div></div>
reverse an animation after div:hover
You can use transition
instead of animation
.owl-stage {padding-top: 10px;}
.owl-item:hover {
margin-top: -10px;
}
.owl-item {
width: 100px;
height: 100px;
background-color: blue;
transition: margin-top 0.5s ease-in-out;
}
<div class="owl-stage">
<div class="owl-item">
</div>
</div>
Related Topics
Css3 Selector :First-Of-Type With Class Name
Svg Data Image Not Working as a Background-Image in a Pseudo Element
How to Make Flexbox Children 100% Height of Their Parent
How to Vertically Center ≪Div≫ Inside the Parent Element With Css
Child With Max-Height: 100% Overflows Parent
Is There a CSS Hack to Affect Safari Only Not Chrome
Css3 Background Image Transition
Understanding Z-Index Stacking Order
Difference Between Style = "Position:Absolute" and Style = "Position:Relative"
::Slotted CSS Selector For Nested Children in Shadowdom Slot
Import Regular CSS File in Scss File
Formatting Numbers (Decimal Places, Thousands Separators, Localization, etc) With CSS
Better Way to Set Distance Between Flexbox Items
Aligning Grid Items Across the Entire Row/Column (Like Flex Items Can)