To achieve a smooth transition effect, you can utilize CSS3 transitions:
#on-hover {
opacity:0;
/* Firefox */
-moz-transition-property: opacity;
-moz-transition-duration: 2s;
-moz-transition-delay: 1s;
/* WebKit */
-webkit-transition-property: opacity;
-webkit-transition-duration: 2s;
-webkit-transition-delay: 1s;
/* Opera */
-o-transition-property: opacity;
-o-transition-duration: 2s;
-o-transition-delay: 1s;
/* Standard */
transition-property: opacity;
transition-duration: 2s;
transition-delay: 1s;
}
#on-hover:hover {
opacity:1;
}
View the complete working example here: http://jsfiddle.net/djwave28/CuNkZ/2/
For more in-depth information on CSS3 transitions and how they can be used to create visually appealing effects, visit:
Please note that this technique may not function as intended in IE9 and older versions, but it is reportedly compatible with IE10 based on documentation. If necessary, you can replicate the effect using JavaScript, although the query specifically pertained to CSS.