Intro section dropdown navigation using Tailwind CSS

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?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @ramawib
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!
Join 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