Submitted over 2 years ago
Intro section dropdown navigation using Tailwind CSS
@antonio-lopez
Design comparison
SolutionDesign
Solution retrospective
Learned about the mouseover
and mouseenter
event for mouse hover. Ended up using mouseenter
and mouseleave
to show and hide the desktop menu when the mouse hovers over the navbar options. What is another way to achieve the hover affect?
Community feedback
- @ramawibPosted over 2 years ago
I used mouseover and mouseout for my code to change the arrow image src on hover. It looks something like this:
featuresMenu.addEventListener("mouseout", function () { dropDown1.style.display = "none"; arrow[0].src = "images/icon-arrow-down.svg"; });
For showing and hiding dropdown menu, I used CSS :hover instead. Hope that helps!
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord