css - Fade in fade out on image hover using CSS3? -
i wondering if possible state unhover class @ on image?
what trying achieve when hovers on image fade in , when unhover fades out?
heres code, got fade in work when hovers on image need fade out when unhover... hope made sense.
this should work you! http://jsfiddle.net/l7xcd/1/
let's use great mozilla documentation explain this:
transition rovide way control speed of animation changes css properties. instead of having animation changes take effect instantly, can transition property changes on specified time period.
also used transition timing functions (ease, linear, easy-in, easy-out, easy-in-out)
timing functions determine how intermediate values of transition calculated. timing function can specified providing graph of corresponding function, defined 4 points defining cubic bezier
ccs markup:
img { opacity: 0.6; transition: opacity 1s ease-in-out; -moz-transition: opacity 1s ease-in-out; -webkit-transition: opacity 1s ease-in-out; } img:hover { opacity: 1.0; transition: opacity .55s ease-in-out; -moz-transition: opacity .55s ease-in-out; -webkit-transition: opacity .55s ease-in-out; }รข
since using transition ease-in-out, thought better use same transition function.
for more information, check documentation here
hope helps!
Comments
Post a Comment