I was working on a responsive mobile menu and used a toggleClass function to open the menu. It's functioning correctly in Jfiddle and below, but every time I click the nav icon in the live preview within brackets, nothing happens. I even tried it in a new blank brackets project, but still no luck.
Code available in Jfiddle as well as below
Your assistance is greatly appreciated. Thank you for your time!
https://jsfiddle.net/TonyTheOnly/7ha214r0/1/
$(document).ready(function(){
$(".burger-nav").on("click", function(){
$("nav ul").toggleClass("open");
});
});
header {
background: white;
padding-bottom: 20px;
}
nav {
float: right;
padding-right: 10%;
}
nav ul {
margin: 0;
padding: 0;
list-style: none;
}
nav li {
display: inline-block;
margin-left: 35px;
padding-top: 25px;
position: relative;
}
nav a {
color: #444;
text-decoration: none;
text-transform: uppercase;
font-size: 24px;
}
nav a:hover {
color: #000;
}
nav a::before {
content: '';
display: block;
height: 10px;
width: 0%;
background-color: #444;
position: absolute;
top: 0;
transition: all ease-in-out 150ms;
}
nav a:hover::before {
width: 100%;
}
@media only screen and (max-width:480px) {
.burger-nav{
display: block;
height: 40px;
width: 40px;
float: right;
background: url("https://cdn4.iconfinder.com/data/icons/wirecons-free-vector-icons/32/menu-alt-512.png");
background-size: cover;
cursor: pointer;
}
.wrapper {
width: 100%;
padding: 0;
}
nav ul {
overflow: hidden;
background: white;
height:0;
}
nav ul.open {
height: auto;
}
nav ul li{
float:none;
text-align: left;
width: 100%;
margin: 0;
}
nav ul li a {
color: black;
padding: 10px;
display: block;
margin: 0;
}
}
@media only screen and (max-width:1050px) {
.burger-nav{
display: block;
height: 40px;
width: 40px;
float: right;
background: url("https://cdn4.iconfinder.com/data/icons/wirecons-free-vector-icons/32/menu-alt-512.png");
background-size: cover;
cursor: pointer;
}
.wrapper {
width: 100%;
padding: 0;
}
nav ul {
overflow: hidden;
background: white;
height:0;
}
nav ul.open {
height: auto;
}
nav ul li{
float:none;
text-align: left;
width: 100%;
margin: 0;
}
nav ul li a {
color: black;
padding: 10px;
display: block;
margin: 0;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<title>Responsive menu</title>
<div class="container">
<nav>
<a class="burger-nav"></a>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</div>