This is what I have:
.box{
background:#FFF;
-webkit-transition: background 0.5s;
}
.box:hover{
background:#000;
}
But this appends to both onmouseover and onmouseout actions, but isn't there a way to control them? Something like:
-wekbkit-transition-IN: background 1s;
-webkit-transition-OUT: background 10s;
The transition-duration CSS property sets the length of time a transition animation should take to complete. By default, the value is 0s , meaning that no animation will occur.
The fade transition in CSS is a stylistic effect that lets elements such as background, image, or text gradually disappear or appear on a web page. To apply a fade-out effect on an element, you need to use either the animation or transition property in CSS.
A fade in is an opening shot or transition technique film editors use to ease viewers into new imagery, rather than using a sudden cut from scene to scene.
Just redifine your transition in the over pseudo element.
.box{
background: white;
-webkit-transition: background 5s;
}
.box:hover{
background: olive;
-webkit-transition: background 1s;
}
Look my http://jsfiddle.net/DoubleYo/nY8U8/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With