Answer the question
In order to leave comments, you need to log in
How to finalize a CSS 3 accordion menu based on the "transition" property?
Good afternoon!
I implemented an accordion menu on my site using the "transition" property, but I would like to refine something ....
css example for clarity
.akkordeon ul{
display:block;
overflow: hidden;
height:50px;
transition: height 1s ease-in-out;
-webkit-transition: height 1s ease-in-out;
}
.akkordeon ul:hover{
height:300px;
}
Answer the question
In order to leave comments, you need to log in
Use the same hover, but in jquery - assign the active class to the menu item according to the haver.
And so - I do not advise using hover for such an important thing as a menu. Use hover as an aid, as the main - click.
To eliminate your problem, the following option immediately comes to mind: when having a haver, set some variable to false and start a timeout for the duration of the animation. After executing the timeout, set this variable to true. Accordingly, when having a check, check the value of the variable, and if it is false, do not process the hover event.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question