JSFiddle - React, Tailwind, and code Playground
HTML
<ul class="myMenu">
<li class="new-dropdown1">
<a id="services" href="#" class="link-hover">Our Services</a>
<ul class="new1">
<li><a href="<?php echo site_url('/structural-capital');?>">Structural-Capital</a></li>
<li><a href="<?php echo site_url('/financial-advisory');?>">Financial-Advisory</a></li>
<li><a href="<?php echo site_url('/investment-capital');?>">Investment-Capital</a></li>
</ul>
</li>
</ul>
CSS
ul {
padding: 0;
}
li {
list-style: none;
}
.myMenu > li {
line-height: 3;
}
.myMenu-active {
background-color: #aaa;
}
.myMenu > li > * {
line-height: 1.2;
}
/* line 1164, ../scss/_custom.scss */
li.new-dropdown, li.new-dropdown1 {
position: relative;
}
/* line 1167, ../scss/_custom.scss */
ul.new, ul.new1 {
position: relative;
display: none;
z-index: 100;
overflow: hidden;
text-overflow: ellipsis;
background: #FFF02A;
}
/* line 1177, ../scss/_custom.scss */
.myMenu li ul {
//display: none;
white-space: nowrap;
}
/* line 1181, ../scss/_custom.scss */
ul.new li > a, ul.new1 li > a {
color: #000;
width: 100%;
/*border-bottom: 1px solid black;*/
}
/* line 1186, ../scss/_custom.scss */
ul.new li > a:hover, ul.new1 li > a:hover {
color: #000 !important;
font-weight: bold;
}
/* line 1190, ../scss/_custom.scss */
ul.new li > a.active, ul.new1 li > a.active {
color: #000 !important;
font-family: 'Neuzeit Grotesk W01';
font-style: normal;
font-weight: bolder;
}
JavaScript
$(document).ready(function () {
function openSubMenu() {
event.stopPropagation();
$(this).addClass('myMenu-active');
$(this).find('ul').css('visibility', 'visible').stop().slideDown(200);
}
function closeSubMenu() {
event.stopPropagation();
var $elem = $(this);
$elem.find('ul').stop().slideUp(200, function () {
$elem.removeClass('myMenu-active');
});
}
$('.myMenu > li').on('mouseenter', openSubMenu);
$('.myMenu > li').on('mouseleave', closeSubMenu);
});