Denne virker IKKE på mobilen!
Chris Coyier on Jun 21, 2019
This is a fairly old UX concept that I haven’t heard talked about in a while, but is still relevant in the case of multi-level dropdown menus. A fine-grained pointer like a mouse sometimes has to travel through pretty narrow corridors to accurately get where it needs to in a dropdown menu. It’s easy to screw up (have the mouse pointer leave the path) and be penalized by having it close up on you. Perhaps we can make that less frustrating.
nav > ul > li { display: inline-block } nav > ul > li ul { visibility: hidden; position: absolute; top: 105%; left: 0; transition: 0.2s 1s; } nav > ul > li:hover ul { visibility: visible; transition-delay: 0s; } nav ul { list-style: none; padding: 0; margin: 0; } nav li { width: 100px; background: #eee; margin: 2px; position: relative; padding: 10px; } nav a { display: block; }
<nav> <ul> <li><a href="">Last</a></li> <li><a href="">one</a></li> <li><a href="">is</a></li> <li> Dropdown <ul> <li><a href="#">One</a></li> <li><a href="#">Two</a></li> <li><a href="#">Three</a></a></li> </ul> </li> </ul> </nav>