html - CSS3 menu fadeOut not working in firefox -
i'm trying create menu simple fade effect. working fine in chrome, when leave mouse , move mouse in dropdown remains on place cause of animation. however: in firefox animation menuhoverfadeout
not working @ all. in firefox animation makes no sense. using following css code:
#cssmenu li > ul { background: #005588; border: 1px solid #004477; position: absolute; width: auto; z-index: 5000; opacity:0; animation: menuhoverfadeout 0.5s ease-in-out; -webkit-animation: menuhoverfadeout 0.5s ease-in-out; /* safari , chrome */ animation-transition-property: opacity; top:-9999px; } #cssmenu li:hover > ul { opacity:1; animation: menuhoverfadein 0.5s linear; -webkit-animation: menuhoverfadein 0.5s linear; top:auto; } @keyframes menuhoverfadein { {opacity:0;}to {opacity:1;} } @-webkit-keyframes menuhoverfadein { {opacity:0;}to {opacity:1;} } @keyframes menuhoverfadeout { 0% {opacity:1;top:initial;} 50% {opacity:1;top:initial;} 100% {opacity:0;top:-9999;} } @-webkit-keyframes menuhoverfadeout { 0% {opacity:1;top:initial;} 50% {opacity:1;top:initial;} 100% {opacity:0;top:-9999;} }
with following html structure:
<div id='cssmenu'> <ul id='main'> <li>home <ul> <li>test1</li> <li>test2</li> <li>test3</li> </ul> </li> <li>about <ul> <li>test1</li> <li>test2</li> <li>test3</li> </ul> </li> </ul> </div>
i see way works in chrome, tried in transition didn't work in it.
provide browser specific prefix firefox (and opera):
@-webkit-keyframes menuhoverfadeout { /* ... */ } @-moz-keyframes menuhoverfadeout { /* ... */ } @-o-keyframes menuhoverfadeout { /* ... */ } @keyframes menuhoverfadeout { /* ... */ } /* (...) */ #cssmenu li > ul { -webkit-animation: menuhoverfadeout 0.5s ease-in-out; -moz-animation: menuhoverfadeout 0.5s ease-in-out; -o-animation: menuhoverfadeout 0.5s ease-in-out; animation: menuhoverfadeout 0.5s ease-in-out; /* ... , on */ }
anyway,
i don't understand why bothering animation
. after egzamining effect you're trying achieve, think simpler use transition
:
-webkit-transition: opacity 500ms ease-in-out; -moz-transition: opacity 500ms ease-in-out; -ms-transition: opacity 500ms ease-in-out; -o-transition: opacity 500ms ease-in-out; transition: opacity 500ms ease-in-out;
Comments
Post a Comment