I have a hamburger menu icon displayed and want it to have a drop down menu, shown here:
<div id="nav-icon">
<div id="hamburger-nav"></div>
<ul id="nav-list">
<li><a id="about" href="#about">about</a></li>
<li><a id="work" href="#work">work</a></li>
<li><a id="contact" href="#contact">contact</a></li>
</ul>
</div>
This menu's display is set to "none". Below is my jQuery I am using to display the nav list. I want it to appear when clicked and disappear when clicked again (toggle). Why does this not work? What adjustments need to be made? jsfiddle here
$(document).ready(function() {
var n = $("#nav-list");
$("#nav-icon").click(function() {
if (n.css("display, none")) {
n.css("display, block");
} else {
n.css("display, none");
}
});
});