And only when everyone is convinced that he will not work only with css:
http://jsfiddle.net/Xkee9/36/
I used the animation for the center of the mouse and the transition for the mouse
Edit: firefox fix added
Edit: Explanation:
(I always use -webkit- -prefixes, just to explain it in Chrome and Safari, Firefox uses -moz- -prefix, opera -o-prefix)
When nothing happens:
the block is at the bottom of div.blocks ( top:80px; ), with opacity 0, there is also no animation running
When freezing:
the block moves instantly at the top without a transition (see -webkit-transition: none; ), because then the down-1 animation is performed. This animation moves the block from top:0 to top:40px; at .25s. After the animation, the block remains at top:40px; because this is what I added to .blocks:hover .blocks_title .
When mousleaving:
there is no more animation, but the block moves from top:40px to top:80px; in .25s due to -webkit-transition: all .25s;
Puyol
source share