Mobile Navigation Menu with JQuery [SOLVED]
Hello!
I'm working on a website with mobile-first responsive design (just like everyone and their mother) and I have been struggling with the navigation bar. I tried following
this tutorial but I've been having some problems.
The navigation menu does indeed hide the normal menu, and display the menu a element, but the menu image does not display, and when clicking on the a element, the menu does not appear; no Jquery seems to be loaded.
I've triple checked all my image and script srcs, and they all appear to be correct.
Here is my site. It is the first website I have ever created from scratch, and it is very much a work in progress. Feel free to point out any other obvious mistakes or nonsensicals that you are sure to find.
Thank you so much!
And for convenience, here is my html, css, and jquery for said navigation bar:
HTML:
- <nav class = "clearfix">
- <ul class = "clearfix">
- <li><a href = "#">Contact</a></li>
- <li><a href = "#">About</a></li>
- <li><a href = "#">Services</a></li>
- <li><a href = "#">Home</a></li>
- </ul>
- <a href = "#" id = "pull">Menu</a>
- </nav>
CSS:
- nav {
- position: relative;
- float: center;
- background-color: #70A5D0;
- height: 3.5em;
- }
- nav ul {
- display: none;
- height: auto;
- }
- nav li {
- display: inline;
- }
- nav li a {
- font-size: 0.95em;
- text-align: center;
- color: #FFFFFF;
- text-decoration: none;
- padding: 1.25em 0;
- width: 6.25em;
- float: right;
- display: inline-block;
- }
- nav li a:hover, nav a:active {
- background: #1B80B7;
- }
- nav a#pull {
- float: right;
- display: block;
- position: relative;
- }
- nav a#pull:after {
- content:"";
- background: url("images/logo/nav-icon.png") no-repeat;
- width: 30px;
- height: 30px;
- display: inline-block;
- position: absolute;
- right: 15px;
- top: 10px;
- }
- @media screen and (min-width: 40.5em) {
- nav {
- top: -1.25;
- }
- nav ul {
- display: inline;
- padding-right: 6em;
- text-align: center;
- }
- nav a#pull {
- display: none;
- }
- }
JQuery:
- $(document).ready(function() {
- $('#comDiv').click(function() {
- $('#comP').slideToggle('slow');
- });
- $('#resDiv').click(function() {
- $('#resP').slideToggle('slow');
- }):
- });
Thank you!!!