Ok so thats the problem here: I want a panel to be displayed when I hover over each nav li item. But it just don't work.
The html:
<nav class="row">
<ul class="nav header-nav">
<li>
<a href="#">item 1</a>
</li>
<li>
<a href="#">item 2</a>
</li>
<li>
<a href="#">item 3</a>
</li>
</ul>
</nav>
<div class="dropdown-parent">
<div class="dropdown-panel row">
</div>
</div>
And here's the css:
.header-nav{
height: 80px;
width:100%;
display: flex;
justify-content: space-between;
li{
background-color:$honey;
position: relative;
height:77px;
width:9.8%;
margin:1px;
margin-top:0px;
border-radius: 7px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
box-shadow: inset 0 0 10px 0px black;
a{
color:black;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
}
}
.dropdown-parent{
text-align: center;
display:none;
.dropdown-panel{
margin-top:2px;
padding-top:50px;
padding-bottom:50px;
display:inline-block;
width:95%;
height: auto;
background-color:white;
z-index:1;
box-shadow: inset 0 0 10px 0px black;
}
}
So I made a simple css on hover animation to display .dropdown-parent:
.header-nav{
li{
&:hover{
.dropdown-parent{
display:block !important;
}
}
}
}
Unfortunately It didn't work and I can't pinpoint the reason why. I even tried to bypass the issue by using jquery but that doesn't seem to help either...
$(document).ready(function(){
$("header-nav li").hover(function(){
$("dropdown-parent").css("display", "block");
});
});
So what's going on here?