33
rated 0 times
[
37]
[
4]
/ answers: 1 / hits: 22365
/ 4 Years ago, tue, december 8, 2020, 12:00:00
i wanna build a menu that is shown on mouseover and displays elements:
category:
- sub-category1
- sub-category2
I managed to accomplish that, but my problem is that when i hover over the menu and it shows the elements inside and i move the mouse away from the menu itself, the elements dont hide.
Here is my code:
<div x-data="{open: false}">
<button @mouseover="open = true">Category</button>
<div x-show="open" @mouseout="open = false" class="h-80 bg-red-900">
<ul>
<li>Sub-category 1</li>
<li>Sub-category 2</li>
</ul>
</div>
</div>
More From » html