JSFiddle - React, Tailwind, and code Playground
by anay1231
HTML
<div class="custom-menu menu"><span class="custom-nav-toggle"><span>Toggle Nav</span></span>
<ul>
<li><a title="Home" href="{{config path="web/secure/base_url"}}">Home</a></li>
<li><a title="About Us" href="{{config path="web/secure/base_url"}}about">About Us</a></li>
<li><a title="Customer Service" href="{{config path="web/secure/base_url"}}customer-service">Customer Service</a></li>
<li><a title="Wholesale" href="{{config path="web/secure/base_url"}}wholesale">Wholesale</a></li>
<li><a title="Testimonials" href="{{config path="web/secure/base_url"}}testimonials">Testimonials</a></li>
<li><a title="Contact Us" href="{{config path="web/secure/base_url"}}Contacts">Contact Us</a></li>
<li><a title="About Us Video" href="{{config path="web/secure/base_url"}}">About Us Video</a></li>
</ul>
</div>
CSS
.custom-menu {
padding: 0 10px;
display: block;
width: 100%;
box-sizing: border-box;
margin-left: auto;
margin-right: auto;
}
.custom-menu .custom-nav-toggle {
display: block;
cursor: pointer;
font-size: 0px;
line-height: 22px;
width: 100%;
background: url(https://www.superiorhorns.com/skin/frontend/default/jm_tube/images/menu-icon.png) no-repeat 16px top;
height: 32px;
padding: 8px 0;
font-size: 17px;
text-transform: uppercase;
top: 60px;
color: #fff;
margin: 0;
}
.custom-menu .custom-nav-toggle span {
display: none;
}
.custom-menu ul {
display: none;
margin: 0;
padding: 0;
}
.custom-menu ul li {
width: 100%;
display: inline-block;
float: left;
list-style: none;
margin: 0;
}
.custom-menu ul li a {
color: #FFFFFF;
background: #bf4f14;
border-radius: 5px;
display: block;
float: left;
text-decoration: none;
padding: 0 20px;
line-height: 30px;
font-weight: bold;
text-transform: uppercase;
margin: 0 0px 5px 17px;
font-family: Arial,sans-serif;
font-size: 12px;
box-sizing: border-box;
margin: 0 0px 5px 0;
width: 100%;
}
JavaScript
jQuery(document).ready(function() {
jQuery(".custom-menu .custom-nav-toggle").click(function(event) {
event.preventDefault();
jQuery(this).toggleClass("current");
jQuery(this).next().slideToggle();
});
});