Cant get a dropdown to appear below the clicked nav item #1872
-
Beta Was this translation helpful? Give feedback.
Answered by
estevanmaito
Jun 2, 2020
Replies: 1 comment 1 reply
-
I indented it better so you can see what is going on: <div class="relative">
<a x-on:click="open = !open" class="text-white group inline-flex items-center space-x-2 text-base leading-6 font-medium hover:text-gray-900 focus:outline-none focus:text-gray-900 transition ease-in-out duration-150">
<span class="cursor-pointer">More Services</span>
</a>
</div> <!-- 👈 this is the end of the relative div -->
<!-- 👇 this is outside of the relative div, and is treated like the other nav links -->
<div x-show="open" x-description="Profile dropdown panel, show/hide based on dropdown state."
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="transform opacity-0 scale-95"
x-transition:enter-end="transform opacity-100 scale-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="transform opacity-100 scale-100"
x-transition:leave-end="transform opacity-0 scale-95"
class="absolute left-75 top-20 w-48 rounded-md shadow-lg z-30">
<div x-on:click.away="open = false" class="py-1 rounded-md bg-white shadow-xs" role="menu" aria-orientation="vertical" aria-labelledby="user-menu">
<a href="/" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out">Home</a>
<a href="/contruction" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out">Construction</a>
<a href="/showers" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out">Shower Units</a>
<a href="/storage" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 transition duration-150 ease-in-out">Storage</a>
</div>
</div> Move the dropdown |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
finchy70
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I indented it better so you can see what is going on: