FILE STRUCTURE
INDEX.HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"
/>
<title>Multilevel Responsive Navigation</title>
<link
href="https://fonts.googleapis.com/css?family=Exo+2:300,400" rel="stylesheet" />
<link
rel="stylesheet" type="text/css" media="all" href="css/atechnav.css"
/>
</head>
<body>
<div class="atechnav">
<ul>
<li><a href="">Home</a></li>
<li><a href="">About</a></li>
<li><a href="">Contact</a></li>
<li><a href="">Services</a></li>
<li>
<a href="">Dropdown Right</a>
<ul>
<li>
<a href="#">Item 1</a>
<ul>
<li>
<a href="#">Item</a>
<ul>
<li>
<a href="#">Item</a>
<ul>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
</ul>
</li>
<li>
<a href="#">Item 4</a>
<ul>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
</ul>
</li>
<li class="mega" data-column="5"><a href="">Mega Dropdown</a>
<ul>
<li><a href="#">Item 1</a>
<ul>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
<li><a href="#">Item 2</a>
<ul>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
<li><a href="#">Item 3</a>
<ul>
<li><a href="#">Item</a>
<ul>
<li><li><a href="#">Item</a></li></li>
<li><li><a href="#">Item</a></li></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Item 4</a>
<ul>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
<li><a href="#">Item 5</a>
<ul>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
<li><a href="#">Item 6</a>
<ul>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
<li><a href="#">Item 7</a>
<ul>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
<li><a href="#">Item 8</a>
<ul>
<li><a href="#">Item</a>
<ul>
<li><li><a href="#">Item</a></li></li>
<li><li><a href="#">Item</a></li></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Item 9</a>
<ul>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
<li><a href="#">Item 10</a>
<ul>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
</ul>
</li>
<li class="drop-left">
<a href="">Drop Left</a>
<ul>
<li>
<a href="#">Item</a>
<ul>
<li>
<a href="#">Item</a>
<ul>
<li>
<a href="#">Item</a>
<ul>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!-- .atechnav -->
<!-- required -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="js/atechnav.js"></script>
<script type="text/javascript">
jQuery(document).ready(function ($) {
jQuery(".atechnav").atechnav({
theme: "light",
breakpoint: 960,
position: "right",
phoneBtn: "9999999999",
locationBtn: "https://www.google.com/maps",
});
});
</script>
<script src="https://code.jquery.com/jquery-migrate-3.0.1.js"></script>
</body>
</html>
ATECHNAV.CSS
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap');
* {
margin: 0;
padding: 0;
}
body {
height: 3200px;
font-size: 16px;
font-family: 'Montserrat', sans-serif;
background: #efefef;
color: #555;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
@media only screen and (max-width: 1000px) {
.atechnav > ul > li > a {
padding: 20px 23px;
}
}
/* all nav */
.atechnav {
position: relative;
width: 100%;
z-index: 9900;
line-height: normal;
}
.atechnav a {
color: rgb(24, 24, 24);
}
.atechnav ul {
margin: 0;
padding: 0;
text-align: center;
}
.atechnav li {
list-style: none;
display: block;
margin: 0;
padding: 0;
position: relative;
line-height: normal;
vertical-align: middle;
}
.atechnav li a {
padding: 15px;
display: block;
text-decoration: none;
color: rgb(24, 24, 24);
font-size: inherit;
font-family: inherit;
box-sizing: border-box;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
/* main level */
.atechnav > ul > li {
display: inline-block;
}
.atechnav > ul > li > a {
padding: 20px 40px;
}
/* first level dd */
.atechnav ul ul {
top: auto;
width: 220px;
position: absolute;
z-index: 9900;
text-align: left;
display: none;
background: #ddd;
}
.atechnav li li {
display: block;
}
/* second level dd */
.atechnav ul ul ul {
top: 0; /* dd animtion - change to auto to remove */
left: 220px;
}
.atechnav > ul > li:hover > ul > li:hover > ul {
opacity: 1;
visibility: visible;
top: 0;
}
/* .drop-left */
.atechnav > ul > li.drop-left > ul {
right: 0;
}
.atechnav li.drop-left ul ul {
left: auto;
right: 220px;
}
/* light theme */
.atechnav.light {
background: rgba(255, 255, 255, 1);
}
.atechnav.light a {
color: #000;
}
.atechnav.light ul ul {
background: rgba(255, 255, 255, 1);
}
.atechnav.light li a {
color: #000;
}
/* dark theme */
.atechnav.dark {
background: rgba(0, 0, 0, 1);
}
.atechnav.dark a {
color: #fff;
}
.atechnav.dark ul ul {
background: rgba(0, 0, 0, 1);
}
.atechnav.dark li a {
color: #fff;
}
/* sticky nav */
.atechnav.fixed {
position: fixed;
width: 100%;
top: 0;
left: 0;
z-index: 9999;
}
/* only used when 'scrollbarFix' is set to true in the js. This fixes horizontal scrollbar caused by the dd menus that are very long.*/
body.atechnav-noscroll-x {
overflow-x: hidden;
}
/* general styling */
.atechnav li.has-sub > a:after {
content: "";
margin-left: 10px;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid #000;
display: inline-block;
}
.atechnav li li.has-sub > a:after {
margin-left: 10px;
float: right;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 6px solid #fff;
position: relative;
top: 4px;
}
.atechnav li.drop-left li.has-sub > a:after {
float: left;
margin-right: 10px;
border-left: 0;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-right: 6px solid #fff;
}
.atechnav.hide-arrows li.has-sub > a:after,
.atechnav.hide-arrows li li.has-sub > a:after,
.atechnav.hide-arrows li.drop-left li.has-sub > a:after {
display: none;
}
.atechnav .menu-toggle,
.atechnav .close-menu,
.atechnav .call-btn-mobile,
.atechnav .location-btn-mobile {
display: none;
text-transform: uppercase;
text-decoration: none;
}
.atechnav .dd-toggle {
display: none;
position: absolute;
top: 0;
right: 0;
padding: 0;
width: 48px;
height: 48px;
text-align: center;
z-index: 9999;
border: 0;
}
.atechnav.desktop li.has-sub a {
padding-right: 5px;
}
.atechnav.desktop.hide-arrows li.has-sub a {
padding-right: 15px;
}
.atechnav.mobile > ul > li > a.dd-toggle {
padding: 0;
}
.atechnav li.call-btn-mobile,
.atechnav li.location-btn-mobile {
display: none;
}
/* svg icons */
.atechnav svg {
fill: currentColor;
width: 1em;
height: 1em;
position: relative;
top: 2px;
}
/* svg icons */
.atechnav a.dd-toggle .icon-plus {
box-sizing: border-box;
transition: transform 0.3s;
width: 12px;
height: 100%;
position: relative;
vertical-align: middle;
display: inline-block;
color: rgb(34, 34, 34);
}
.atechnav a.dd-toggle .icon-plus:before {
content: "";
display: block;
width: 12px;
height: 0px;
border-bottom: solid 3px rgb(34, 34, 34);
position: absolute;
top: 50%;
transform: rotate(90deg);
transition: width 0.3s;
}
.atechnav a.dd-toggle .icon-plus:after {
content: "";
display: block;
width: 12px;
height: 0px;
top: 50%;
border-bottom: solid 3px rgb(31, 31, 31);
position: absolute;
}
.atechnav li.open > a.dd-toggle .icon-plus {
-webkit-transform: rotate(135deg);
-ms-transform: rotate(135deg);
-o-transform: rotate(135deg);
transform: rotate(135deg);
}
.atechnav.light a.dd-toggle .icon-plus:before {
border-color: #000;
}
.atechnav.light a.dd-toggle .icon-plus:after {
border-color: #000;
}
.atechnav.dark a.dd-toggle .icon-plus:before {
border-color: #fff;
}
.atechnav.dark a.dd-toggle .icon-plus:after {
border-color: #fff;
}
.atechnav .icon-close {
box-sizing: border-box;
width: 12px;
height: 12px;
position: relative;
display: inline-block;
}
.atechnav .icon-close:before {
content: "";
display: block;
width: 12px;
height: 0px;
border-bottom: solid 3px rgb(24, 24, 24);
position: absolute;
top: 50%;
transform: rotate(45deg);
}
.atechnav .icon-close:after {
content: "";
display: block;
width: 12px;
height: 0px;
top: 50%;
border-bottom: solid 3px rgb(24, 24, 24);
position: absolute;
transform: rotate(-45deg);
}
.atechnav.light .icon-close:before {
border-color: #000;
}
.atechnav.light .icon-close:after {
border-color: #000;
}
.atechnav.dark .icon-close:before {
border-color: #fff;
}
.atechnav.dark .icon-close:after {
border-color: #fff;
}
/* mobile nav */
.atechnav .menu-toggle,
.atechnav .call-btn-mobile,
.atechnav .location-btn-mobile,
.atechnav .close-menu {
padding: 15px;
box-sizing: border-box;
}
.atechnav .menu-toggle span.bars {
display: inline-block;
margin-right: 7px;
position: relative;
top: 3px;
}
.atechnav .menu-toggle span.bars span {
display: block;
width: 15px;
height: 2px;
border-radius: 6px;
background: rgb(24, 24, 24);
margin: 0 0 3px;
}
.atechnav .full {
width: 100%;
}
.atechnav .half {
width: 50%;
}
.atechnav .third {
width: 33%;
text-align: center;
}
.atechnav .location-btn-mobile.third {
text-align: center;
}
.atechnav .location-btn-mobile.half {
text-align: right;
}
.atechnav.light .third,
.atechnav.light .half {
border-left: 1px solid rgba(0, 0, 0, 0.15);
}
.atechnav.light.left .third,
.atechnav.light.left .half {
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
.atechnav.light.right .third,
.atechnav.light.right .half {
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
.atechnav.light .third:first-child,
.atechnav.light .half:first-child {
border-left: 0;
}
.atechnav.dark .third,
.atechnav.dark .half {
border-left: 1px solid rgba(255, 255, 255, 0.15);
}
.atechnav.dark.left .third,
.atechnav.dark.left .half {
border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.atechnav.dark.right .third,
.atechnav.dark.right .half {
border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.atechnav.light.left .menu-toggle,
.atechnav.light.right .menu-toggle {
border-bottom: 0;
}
.atechnav.dark.left .menu-toggle,
.atechnav.dark.right .menu-toggle {
border-bottom: 0;
}
.atechnav.dark .third:first-child,
.atechnav.dark .half:first-child {
border-left: 0;
}
.atechnav.light .menu-toggle span.bars span {
background: #000;
}
.atechnav.dark .menu-toggle span.bars span {
background: #fff;
}
.atechnav.mobile {
position: static;
}
.atechnav.mobile.fixed {
position: static;
}
.atechnav.mobile ul {
position: relative;
display: none;
}
.atechnav.mobile.active {
padding-bottom: 0;
}
.atechnav.mobile.active > ul {
display: block;
}
.atechnav.mobile ul {
text-align: left;
}
.atechnav.mobile > ul > li {
display: block;
}
.atechnav.mobile > ul > li > a {
padding: 15px;
}
.atechnav.mobile ul {
background: rgba(221, 221, 221, 1);
}
.atechnav.mobile ul ul {
position: relative;
opacity: 1;
visibility: visible;
width: auto;
display: none;
-moz-transition: none;
-webkit-transition: none;
-o-transition: color 0 ease-in;
transition: none;
}
.atechnav.mobile ul ul ul {
left: auto;
top: auto;
}
.atechnav.mobile li.drop-left ul ul {
right: auto;
}
.atechnav.mobile li a {
border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.atechnav.mobile > ul {
border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.atechnav.mobile.light li a {
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
.atechnav.mobile.light > ul {
border-top: 1px solid rgba(0, 0, 0, 0.15);
}
.atechnav.mobile li a.dd-toggle {
border: 0;
}
.atechnav.mobile.light li a.dd-toggle {
border: 0;
}
.atechnav.mobile .menu-toggle,
.atechnav.mobile .dd-toggle,
.atechnav.mobile .close-menu,
.atechnav.mobile .call-btn-mobile,
.atechnav.mobile .location-btn-mobile {
display: inline-block;
}
.atechnav.mobile li.call-btn-mobile {
border-right: 1px solid rgba(255, 255, 255, 0.1);
box-sizing: border-box;
}
.atechnav.mobile li.call-btn-mobile,
.atechnav.mobile li.location-btn-mobile {
display: inline-block;
width: 50%;
text-transform: uppercase;
text-align: center;
}
.atechnav.mobile li.call-btn-mobile.full,
.atechnav.mobile li.location-btn-mobile.full {
display: block;
width: 100%;
text-transform: uppercase;
border-right: 0;
text-align: left;
}
.atechnav.mobile.light ul {
background: rgba(255, 255, 255, 1);
}
.atechnav.mobile.dark ul {
background: rgba(0, 0, 0, 1);
}
.atechnav.mobile.dark ul ul {
background: rgba(255, 255, 255, 0.08);
}
.atechnav.mobile.light li.call-btn-mobile {
border-right: 1px solid rgba(0, 0, 0, 0.1);
}
.atechnav.mobile.top {
position: absolute;
width: 100%;
top: 0;
left: 0;
z-index: 9999;
}
.atechnav.mobile li.has-sub > a:after,
.atechnav.mobile li li.has-sub > a:after,
.atechnav.mobile li.drop-left li.has-sub > a:after {
display: none;
}
/* left and right positions */
.atechnav.mobile.right > ul,
.atechnav.mobile.left > ul {
position: fixed;
top: 0;
bottom: 0;
width: 100%;
max-width: 280px;
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.atechnav.mobile.right > ul {
right: 0;
}
.atechnav.mobile.right .close-menu,
.atechnav.mobile.left .close-menu {
display: inline-block;
text-align: right;
}
.atechnav.mobile.left > ul {
left: 0;
}
.atechnav.mobile.right .location-btn-mobile.half,
.atechnav.mobile.right .call-btn-mobile.half,
.atechnav.mobile.right .close-menu.half {
text-align: center;
}
.atechnav.mobile.right .location-btn-mobile.third,
.atechnav.mobile.right .call-btn-mobile.third,
.atechnav.mobile.right .close-menu.third {
text-align: center;
}
.atechnav.mobile.left .location-btn-mobile.half,
.atechnav.mobile.left .call-btn-mobile.half,
.atechnav.mobile.left .close-menu.half {
text-align: center;
}
.atechnav.mobile.left .location-btn-mobile.third,
.atechnav.mobile.left .call-btn-mobile.third,
.atechnav.mobile.left .close-menu.third {
text-align: center;
}
.atechnav.mobile.left .menu-toggle.half,
.atechnav.mobile.left .menu-toggle.third,
.atechnav.mobile.right .menu-toggle.half,
.atechnav.mobile.right .menu-toggle.third {
text-align: left;
}
.atechnav.mobile.left .close-menu.third span,
.atechnav.mobile.right .close-menu.third span {
display: none;
}
/* left and right positions */
/* mega dd */
.atechnav.desktop li.mega ul ul {
background: none;
}
.atechnav.desktop li.mega li {
display: inline-block;
vertical-align: top;
margin-left: -4px;
}
.atechnav.desktop li.mega li li {
display: block;
position: relative;
left: 4px;
}
.atechnav.desktop li.mega ul ul {
width: auto;
}
.atechnav.desktop > ul > li.mega {
position: inherit;
}
.atechnav.desktop > ul > li.mega > ul {
width: 100%;
}
.atechnav.desktop > ul > li.mega > ul li.has-sub ul {
display: block;
position: relative;
left: auto;
}
.atechnav.desktop > ul > li.mega > ul > li {
padding-bottom: 15px;
box-sizing: border-box;
}
.atechnav.desktop li.mega li li a {
padding: 5px 15px;
}
.atechnav.desktop li.mega li.has-sub a:after {
display: none;
}
.atechnav.desktop > ul > li.mega > ul > li > a {
color: #202020;
}
/* mega dd */
/* Fallback for slow javascript load */
@media only screen and (max-width: 768px) {
.atechnav {
overflow: hidden;
display: block;
}
.atechnav ul {
position: relative;
display: none;
}
}
/* mobile nav */
@media only screen and (max-width: 420px) {
.atechnav.mobile .call-btn-mobile.third span,
.atechnav.mobile .location-btn-mobile.third span {
display: none;
}
}
atechnav,js