The issue stems from the animation that activates upon exiting the navigation menu. As the menu transitions downward and fades out, encountering the mouse inadvertently triggers a conflicting animation of fading in and moving up.
In the specific scenario you provided, the flickering problem arises only when there is interaction between the cursor and the menu during the animation sequence.
If we assume that your code remains unchanged, the animation is initiated by utilizing the :hover
pseudo selector for the .navbar .dropdown ul
class.
To rectify this, it is recommended to eliminate both instances of the top
property in the following selectors: .navbar .dropdown:hover > ul
and .navbar .dropdown ul
.
.navbar .dropdown:hover > ul {
opacity: 1;
top: 100%; /* Delete This */
visibility: visible;
}
.navbar .dropdown ul {
display: block;
position: absolute;
left: 14px;
top: 100%; /* Delete This */
margin: 0;
padding: 10px 0;
z-index: 99;
opacity: 0;
visibility: hidden;
background: #fff;
box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);
transition: 0.3s;
border-radius: 4px;
}