Big Menus, Small Screens: Responsive, Multi-Level Navigation

Big Menus, Small Screens: Responsive, Multi-Level Navigation

Tutorial Details
  • Topic: Responsive Web Design
  • Difficulty: Advanced
  • Estimated completion time: 30 mins

If you’ve ever worked on a responsive website, you’ve no doubt had to tackle one of the trickiest problems in this emerging field: navigation. For simple navigation, the solutions can be straight-forward. However, if you’re working on something a bit more complex, maybe with multiple nested lists and dropdowns, a more dramatic rearrangement may be in order.

In this approach to responsive navigation, we’re going to use an approach that can accommodate large, multi-level navigation menus using media queries and jQuery, whilst trying to keep our markup simple and our external resources minimal.


The Goal: Responsive Dropdown Menu

Here’s what we’re aiming for:

Goal
  • On larger screens, show a horizontal drop-down menu, with up to 2 levels of sub-menus that appear when parent element is hovered over.
  • On smaller screens, a “menu” button which displays our menu vertically, displaying sub-menus when parent element is clicked/touched.

Step 1: The Markup

Our markup is a fairly straight-forward unordered list, with nested lists contained within list items. I’m intentionally not using any classes or IDs on any element but the parent unordered list, so that the menu will be compatible with CMS-generated menus.

<div class="container">
<a class="toggleMenu" href="#">Menu</a>
<ul class="nav">
	<li  class="test">
		<a href="#">Shoes</a>
		<ul>
			<li>
				<a href="#">Womens</a>
				<ul>
					<li><a href="#">Sandals</a></li>
					<li><a href="#">Sneakers</a></li>
					<li><a href="#">Wedges</a></li>
					<li><a href="#">Heels</a></li>
					<li><a href="#">Loafers</a></li>
					<li><a href="#">Flats</a></li>
				</ul>
			</li>
			<li>
				<a href="#">Mens</a>
				<ul>
					<li><a href="#">Loafers</a></li>
					<li><a href="#">Sneakers</a></li>
					<li><a href="#">Formal</a></li>
				</ul>
			</li>
		</ul>
	</li>

Step 2: Basic Styling

Let’s add some very basic styling to get our list looking like a navigation bar:

body, nav, ul, li, a  {margin: 0; padding: 0;}
body {font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
a {text-decoration: none;}
.container {
    width: 90%;
    max-width: 900px;
    margin: 10px auto;
}
.toggleMenu {
    display:  none;
    background: #666;
    padding: 10px 15px;
    color: #fff;
}
.nav {
    list-style: none;
     *zoom: 1;
     background:#175e4c;
     position: relative;
}
.nav:before,
.nav:after {
    content: " ";
    display: table;
}
.nav:after {
    clear: both;
}
.nav ul {
    list-style: none;
    width: 9em;
}
.nav a {
    padding: 10px 15px;
    color:#fff;
    *zoom: 1;
}
.nav > li {
    float: left;
    border-top: 1px solid #104336;
    z-index: 200;
}
.nav > li > a {
    display: block;
}
.nav li ul {
    position: absolute;
    left: -9999px;
    z-index: 100;
}
.nav li li a {
    display: block;
    background: #1d7a62;
    position: relative;
    z-index:100;
    border-top: 1px solid #175e4c;
}
.nav li li li a {
    background:#249578;
    z-index:200;
    border-top: 1px solid #1d7a62;
}
step 2

We’ve just floated our list items into a horizontal line, set some colors up and hidden the submenus off the screen using absolute positioning. If you’re wondering about line 20, it’s a simple clearfix method that I find effective in these kinds of situations (read more on Nicolas Gallagher’s blog).


Step 3: Horizontal Dropdown Menu

Next, let’s get the horizontal dropdown menus happening. While this could be done with pure CSS using the :hover pseudo-selector, I’m going to add it in using JavaScript since we’re going to be switching the menus to activate on click in our small-screen version.

Since we’re using absolute positioning to move our submenus off the screen, let’s add some .hover rules that will position the submenus relative to their parents when the .hover class is present (which we’ll take care of with jQuery).

.nav li {
    position: relative;
}
.nav > li.hover > ul {
    left: 0;
}
.nav li li.hover ul {
    left: 100%;
    top: 0;
}

Now we’ll add a couple of lines of simple jQuery to add the .hover class to list elements when they’re hovered over.

$(document).ready(function() {
	$(".toggleMenu").css("display", "none");
	$(".nav li").hover(function() {
	 	$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
	});
});
step 3

And just like that, we have ourselves a functional, multi-level dropdown menu.


Step 4: Vertical Dropdown Menu

Our lovely horizontal dropdown menu unfortunately looks quite tiny on mobile screens, so let’s make sure mobile browsers will be fully zoomed-in when they load our page by adding the viewport meta tag.

<meta name="viewport" content="width=device-width, initial-scale=1">

Of course, now our dropdown menu looks even worse on mobile devices, and most of it doesn’t even fit on the screen! Let’s add in some media queries to style our list into a vertical list below our breakpoint. Our breakpoint is determined by the point at which our menu breaks onto two lines, in my case, that’s about 800px.

At our breakpoint, we’ll remove the floats and set the list items and unordered lists to width: 100%. Right now, when we hover over our parent items, their child lists are displayed over top of the items beneath it. We’d rather the other top-level list items get displaced. So instead of changing the left position of the unordered list, we’ll just set the position value to static.

@media screen and (max-width: 800px) {
    .nav > li {
        float: none;
    }
    .nav ul {
        display: block;
        width: 100%;
    }
   .nav > li.hover > ul , .nav li li.hover ul {
        position: static;
    }
}
step 4

Step 5: Converting Hover to Click

Since you can’t hover on a touch screen (yet), we’re going to create some conditional code to check the width of the window, then write the code to set the click() and hover() events.

$(document).ready(function() {
	var ww = document.body.clientWidth;
	if (ww < 800) {
		$(".toggleMenu").css("display", "inline-block");
		$(".nav li a").click(function() {
			$(this).parent("li").toggleClass('hover');
		});
	} else {
		$(".toggleMenu").css("display", "none");
		$(".nav li").hover(function() {
			$(this).addClass('hover');
		}, function() {
			$(this).removeClass('hover');
		});
	}
});

For the click event, we’ve had to change the targeted element from the list item to the parent item, since the lists are nested and clicking one list item could open its grandchildren as well. The problem with this change, however, is that clicking an anchor tag will reload the page, but we can’t prevent default behavior on all anchor tags that are descendants of list items.

To fix this, let’s add a short bit of jQuery to add the class .parent to any list item whose child anchor has siblings, then target only these anchors (again, trying to keep our markup flexible).

$(".nav li a").each(function() {
		if ($(this).next().length > 0) {
			$(this).addClass("parent");
		};
	})
	if (ww < 800) {
		$(".toggleMenu").css("display", "inline-block");
		$(".nav li a.parent").click(function(e) {
			e.preventDefault();
		 	$(this).parent("li").toggleClass('hover');
		});
	} else {
... }

Step 6: Toggle the Menu

Our menu looks pretty nice on mobile devices now, but it’s taking up quite a lot of valuable screen real estate. A popular new approach has been to toggle navigation lists using a button, usually with the word “Menu” or a menu icon. Let’s get our toggle link working to show our navigation list only when clicked.

$(".toggleMenu").click(function(e) {
	e.preventDefault();
	$(".nav").toggle();
});
if (ww < 800) {
	$(".toggleMenu").css("display", "inline-block");
	$(".nav").hide();
} else {
	...
}
step 6

Step 7: A Bit More Style

Since we now have our parent list items targeted with a class, why not add a little down arrow to let our users know which list items have children?

.nav > li > .parent {
    background-position: 95% 50%;
}
.nav li li .parent {
    background-image: url("images/downArrow.png");
    background-repeat: no-repeat;
    background-position: 95% 50%;
}
@media screen and (max-width: 800px) {
 .nav > li > .parent {
        background-position: 95% 50%;
    }
    .nav li li .parent {
        background-image: url("images/downArrow.png");
        background-repeat: no-repeat;
        background-position: 95% 50%;
    }
}
step 7

Bonus: Showing Off

Now, for practical purposes, this menu works quite well. If you open it up in a mobile browser, you’ll get a very usable vertical accordion list, if you open it in your desktop browser, you’ll get a nice horizontal drop-down list. If you resize your desktop browser down to mobile widths, however, our navigation still only works on hover, and the menu isn’t hidden with the toggle feature. For most applications, this is fine. After all, your average web site visitor doesn’t grab the edge of their browser and start dragging madly back and forth.

However, if you’re looking to impress your fellow web professionals, this just won’t do. We’ll need to set up our script to respond to the resize event, and execute our conditional code when the browser is resized below the breakpoint. Expanding on the code demonstrated in the excellent Creating a Mobile-First Responsive Design tutorial, we’re going to set some variables to keep track of and update our browser width.


Step 8: Window Events

Since we want to check the width of the browser both on page load and when the browser is resized, let’s start by moving all the conditional code out of the $(document).ready() event and wrapping it in a function adjustMenu.

var ww = document.body.clientWidth;
$(document).ready(function() {
	$(".toggleMenu").click(function(e) {
		e.preventDefault();
		$(".nav").toggle();
	});
	$(".nav li a").each(function() {
		if ($(this).next().length > 0) {
			$(this).addClass("parent");
		};
	})
	adjustMenu();
});
function adjustMenu() {
	if (ww < 800) {
		$(".toggleMenu").css("display", "inline-block");
		$(".nav").hide();
		$(".nav li a.parent").click(function(e) {
			e.preventDefault();
		 	$(this).parent("li").toggleClass('hover');
		});
	} else {
		$(".toggleMenu").css("display", "none");
		$(".nav li").hover(function() {
		 		$(this).addClass('hover');
			}, function() {
				$(this).removeClass('hover');
		});
	}
}

To call the function as the browser is resized, we’re going to bind it to the window events resize and orientationchange. Inside this event we’re going to redefine the ww variable to adjust to the browser’s new width.

$(window).bind('resize orientationchange', function() {
	ww = document.body.clientWidth;
	adjustMenu();
});

At this point, we’ve introduced more problems: though this initially appears to work (the horizontal menu collapses into the “menu” button which opens the menu), it’s quickly evident we have two big issues:

  1. The entire menu disappears if we resize the mobile-width window back out past the break point.
  2. The hover event is still firing on the mobile version.

Step 9: Showing and Hiding

Our missing navigation menu seems like an easy fix: just add $("nav").show() under the greater-than-breakpoint condition. This solution seems to work, but brings up some tricky edge cases. Since the code is re-evaluated every time the browser is resized, whenever we resize with the menu open, it automatically closes again.

This might seem like an unlikely edge case, but mobile browsers are weird: for example, on my Galaxy S, scrolling down, then back up to the top of a page triggers the resize event. Not good!

To fix this, we need to have some way of checking whether the menu toggle has been clicked. I’m going to use an added class on the menu toggle button, because it could be handy for styling (maybe we want a down arrow later down the line?) In addition to toggling the display of the navigation menu, the menu toggle button will now toggle its own class of .active. Back in our narrower-than-breakpoint condition, let’s update the code to hide our navigation menu only if the menu toggle does not have a class of .active.

$(document).ready(function() {
	$(".toggleMenu").click(function(e) {
		e.preventDefault();
		$(this).toggleClass("active");
		$(".nav").toggle();
	});
});
	if (ww < 800) {
		$(".toggleMenu").css("display", "inline-block");
		if (!$(".toggleMenu").hasClass("active")) {
			$(".nav").hide();
		} else {
			$(".nav").show();
		}
		$(".nav li a.parent").click(function(e) {
			e.preventDefault();
		 	$(this).parent("li").toggleClass('hover');
		});
	} ...

Step 10 Unbinding Hover Events

To solve our problem of the mobile-sized navigation menu responding to hover events, we just have to unbind() the hover event from our list items inside the narrower-than-breakpoint condition.

$(".nav li").unbind('mouseenter mouseleave');

However, this illuminates a new problem: our click events don’t work if you resize the browser from big to small. Some debugging reveals that the click event has been bound to the link a bunch of times, so as soon as we click, the .hover class is toggled on and then immediately off again. This happens because the whole function fires repeatedly as you’re resizing the window. To make sure we start toggling from the right place, we need to unbind the click event before re-binding it again.

Once we resize the browser from small to big again, however, we’re now missing our hover event, because we unbound it when the browser was small, and our click event is still there, so let’s unbind before binding our hover statement too. We’re also going to remove any list items with a class of .hover before we add them back in on the hover event, to prevent menus from awkwardly staying open as we make the browser wider.

I’m rewriting the .click() and .hover() events using .bind() for clarity’s sake. It means the same exact thing.

if (ww < 800) {
	$(".toggleMenu").css("display", "inline-block");
	if (!$(".toggleMenu").hasClass("active")) {
		$(".nav").hide();
	} else {
		$(".nav").show();
	}
	$(".nav li").unbind('mouseenter mouseleave');
	$(".nav li a.parent").unbind("click").bind("click", function(e){
		e.preventDefault();
	 	$(this).parent("li").toggleClass('hover');
	});
} else {
	$(".toggleMenu").css("display", "none");
	$(".nav").show();
            $(".nav li").removeClass("hover");
	$(".nav li a").unbind("click");
	$(".nav li").unbind('mouseenter mouseleave').bind('mouseenter mouseleave', function() {
		$(this).toggleClass('hover');
	});
}

Hooray! It all seems to work as it ought to.


Step 11: Get IE to Behave

It wouldn’t be a party if IE7 didn’t come along to crash it, now would it? We’ve got an odd bug here where our sub-menus disappear when they’re displayed over other content (in our example, some lorem ipsum text). Once the cursor reaches the paragraph element, *poof* no more menu. I’m fairly certain this is due to some weirdness in the way IE7 deals with position: relative;, and the issue is easily solved by triggering hasLayout on the .nav a element.

.nav a {
    *zoom: 1;
}

Further Considerations

As always, you’ll have to make your own judgment call about browser and feature support, but tools like Modernizr and respond.js can take some of the pain out of supporting older browsers.

I’ve tested this menu out on Mobile Safari and every Android 2.3 browser I could get my hands on, and it seems to work quite well. However, this technique is very JavaScript-dependent, and since some mobile browsers (Blackberry generally) have very poor support for JavaScript, we might be leaving some users with an unusable navigation menu.

Fortunately, there are a number of methods you can use to serve simplified layouts to JavaScript-less devices. The good old-fashioned technique of adding a .no-js class to the body tag and removing it in your JavaScript comes to mind, but you could also just provide href attributes for the top-level navigation items, sending users to the general “shoes” category listing for example, and relying on preventDefault to prevent this behavior in JavaScript-enabled devices.

Of course the media queries won’t work in older versions of IE, so you’ll have to decide whether it’s worth including a polyfill such as respond.js to fill this gap.

Last but not least, there’s that pesky iOS bug that causes the zoom level to change when you rotate the device. Check out the iOS Orientationchange Fix script to squash this bug.


Further Reading

Though this technique may be well-suited to certain situations and menu structures, there are still a lot of other options out there for taming navigation on mobile devices. For example:

Feel free to peruse, clone, or fork the GitHub repo, and thanks for reading!

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • masta

    First comment
    Great tuts

  • http://weeklywebfood.com/ Saurabh

    Nice Tutorial. Thanks for sharing.

  • http://php-sri-lanka.blogspot.com Upeksha Wisidagama

    Very Informative. Great content. Thanks.

  • http://curiadesign.net Curia

    Built my own responsive menu just like this, however it does not take into account nested options, so this is a god help, thanks.

  • http://www.lifeinsharepoint.co.uk Chris

    Hi there.

    Thanks for this great script. Only comment is that on the horizontal menu could there be an arrow on each nested menu also? Another comment is that if you want your top level menu (with children) to be clickable when you collapse down to the mobile view this link no-longer becomes clickable. Is there a way round this??

    Other than that :) great!

    • http://godbolt.me Micah

      Hey @chris, I missed your comment here. Clickable primary and secondary links were my exact question as well.

      Check my solution down further in the comments, or just check out http://codepen.io/micahgodbolt/pen/czwer

      • Ryan Scott

        Micah, that is awesome code. I have to implement this on a site where they won’t change the structure (there’s > 300 links), so this is the only way i can make it responsive, and keep existing functionality. You rock.

      • Roy Butterton

        Hey Micah, thanx for the fix of the clickable links, great work!!
        Roy

      • FcoGT

        thanks for sharing this @0fe8bcce8b85d816af0a16a776f04509:disqus !

  • Len

    AWESOME tutorial…thank you!

    Quick question…how can I get the nav in mobile to collapse if I click another link? I’d like this to work more like an ‘accordion’ than sliding panels and I’m a jquery newbie!

  • Len

    I would love the submenu items in the mobile version to have an up arrow when opened to clue the user to close it to collapse.

    I noticed an ‘upArrow’ graphic in the source files but no mention of this?

    How do I go about utilizing this?

    Thanks so much!

    • http://tessathornton.com Tessa Thornton
      Author

      Since we’re toggling the ‘hover’ class when the menu is opened, it shouldn’t be too hard for you to figure out how to take advantage of this in the CSS to change the image!

  • Hanz Tan

    Thanks for this!

    But what if i want the menu to be on the right side of the page and i want the toggled menu aligned to the right?

    How should i do it?

  • http://www.customicondesign.com Custom Icon Design

    yeh, this is the great tutorial. Using javascript and html5 + css is great way to get the website responsive. many thanks for sharing.

  • Hamid

    oh yeah, a responsive nav, keep it up man.

  • http://godbolt.me Micah

    Great demo. I’ve been looking for a pattern like this for a new site I’m building.

    My only change would be to separate the link from the dropdown UI. Most site’s I build have primary and secondary pages that need to be accessed through the navigation (not just the final nav item at the bottom of the hierarchy).

    Here is a quick codepen.io of how I’d update your design to make this possible. I accomplished it by having jQuery add a “more” link after all “parent” links, and then using the “more” link to open and close the navigation item.

    http://codepen.io/micahgodbolt/pen/czwer

  • http://eichefam.net Paul

    I’m surprised that the “desktop version” of the menu breaks with JavaScript disabled. Having a Suckerfish-style menu work on pure css is not all that difficult…

  • Michael

    Hi. Very nice tutorial. I’m having problem with the script working on my WordPress theme. The markup is exactly like the one in this tutorial. Should it not work nicely in WordPress. The problem is the hover part not working. I’ve checked that the jquery file is loaded. So I can’t see what I’m doing wrong…

  • HoweverMoreCorn

    Good results, but I ultimately will devise a different solution. I no longer like relying on js for menus and nav, especially not this much. It’s takes too much code to do such simple things in js (and jquery is even being used). Such a shame.

    • Hozey

      HoweverMoreCorn, when you come up with something please share. I too don’t care for js and query; much prefer a pure css nav menu, but after a week of searching this is the best thing I’ve found so far.

  • Pingback: Tweet Parade (no. 37 Sep 2012) | gonzoblog.nl

  • http://www.cuppawebandgraphics.com Cuppa – Freelance Web Design

    Great post, we will be using this in our future WordPress themes, Thanks

  • Pingback: Wordpress Leaks » Weekly Design News – Resources, Tutorials and Freebies (N.150)

  • Pingback: Weekly Design News – Resources, Tutorials and Freebies (N.150) | Wordpress Webdesigner

  • Pingback: Weekly Design News – Resources, Tutorials and Freebies (N.150) | Web Dezining

  • Pingback: Weekly Design News – Resources, Tutorials and Freebies (N.150) | t1u

  • Pingback: Weekly Design News – Resources, Tutorials and Freebies (N.150) | CSS Tips

  • Pingback: Some links for light reading (19/9/12) | Max Design

  • Sbodrero

    Great post thanks !

  • http://www.twitter.com/dboudreau dboudreau

    Nice tutorial. Too bad this menu doesn’t allow the user to follow visual focus or allow navigation at all while using the keyboard only: http://www.w3.org/TR/WCAG/#keyboard-operation

  • http://www.brookswebdesign.net Maria

    Great tutorial. Nice clean use of Javascript, HTML5 and CSS.

  • Martin

    Works great but silly question, I want to add slideToggle to the sub-menus but for some reason I can’t, I was able to add slideToggle to the main menu when in “mobile” view when the “menu” link was pressed but can’t get the slide down effect for the submenus in both mobile and desktop menu. Any ideas?

  • Pingback: Thursday Roundup # 20 | EGrappler

  • Pingback: Menu déroulant responsive

  • Pingback: Responsive Dropdown Menu Download « Web css jquery

  • Pingback: Weekly Design News – Resources, Tutorials and Freebies (N.150) - Speckyboy Design Magazine

  • http://forwardslashdesigns.com Mark

    Great tutorial, will use this on my next project. Only one question though – is it possible to add some sort of a sliding effect when the buttons are pressed? Maybe through Jquery or even CSS3 (if thats possible)

    Thanks

  • Zanka

    Nice job, but is it possible to animate the menu ?
    With jquery effects of this kind for exemple : .animate({height:’show’, opacity: ‘show’}, 500)

    It would be perfect if it was animated like jquery.superfish and most of jquery accordions scripts

    Thanks for your answer if it’s possible.

  • CC

    Nice one. I’m looking for one that also behaves well in IE 8. Yeah yeah… everyone hates it. This demo ALMOST works perfect in IE 8. what I find is that the menu choices down go down to one per line when window is shrunk, So you could have 2 choices in one row.

  • http://www.facebook.com/colintucker.net Colin Tucker

    Great work, this menu gets us SO close to having a unified multi-level responsive navigation system across all devices… but there’s a problem. I’ve found that when you actually use it for real navigation, as opposed to a demo list with # links, touch devices will not play so nicely.

    It harks back to the hover/touch problem evident with almost all dynamic drop-down menus in use today, especially with Android devices. iOS 5 fixed this problem, but on Android the menu first expands and then goes off to the touched link, unless the user touches and holds the screen, which is definitely not ideal.

    If we can get around this problem, this menu will be super sweet indeed.

  • Pingback: 15+ Comprehensive Responsive Web Design Tutorials | gonzoblog

  • Guest

    Has anyone been able to get this work successfully with BootStrap?

  • Linzi

    I can’t get mine to work in IE7 – any ideas???? http://sccsa.kook.com.au/

  • Pingback: 响应移动设备导航菜单的方法和解决方案 | 我心疯狂

  • Akeisa Lowe

    Great tutorial! Works perfectly fine on my browser (Chrome) but the menu doesn’t work at all on my client’s browser (chrome). Any idea what the issue might be?

    • Varun

      hiiii looking beautiful… may i know ur work and education miss Akeisa…

  • http://www.facebook.com/vinod.cg.1 Vinod CG

    Great

  • Pingback: HueDesigner – Responsive Mobile Navigation Menu – Methods and Solutions

  • maximgrachev

    Great tutorial! Still having a little bit of trouble with clikable sub-submenus, but I’m positive about it :)
    Thanks for this

  • Pingback: Создание многоуровневого адаптивного меню | tutcode.com

  • Nathaniel

    In Chrome as you reduce the page, the menu flashes open for a second. It ends up looking really glitchy. After looking at it more closely, when the window is exactly 768 pixels wide the menu appears tall and vertical, rather than hiding the menu and showing only the “Menu” link.

    • Raghu

      Even Ipad browser same problem is appearing… need a solution for that

    • http://twitter.com/darrenhoyt Darren Hoyt

      If you put a ‘display:none’ on .nav, it should fix that problem.

  • http://www.iamaaron.com/ Aaron Brewer

    Great article… But some of the CSS could be drastically improved.

    • Andrew

      …care to share your solution with regards css optimization? that would be an excellent contribution!

      • http://www.iamaaron.com/ Aaron Brewer

        01: Line 43: background-image, background-repeat, background-position can be put into one declaration.
        02: The .nav class isn’t needed.
        03: Line 39: Float doesn’t need to be declared, just use display: inline-block.
        04:Set the pixel size of fonts on the body and declare throughout the rest of the css using ems. Using ems on width as well.

        Those are just a few… Regardless the rest of the CSS looks like a mess.

  • http://www.facebook.com/HammadDesigns Quéstion Mark

    I was looking for something great tutorial on the same topic.
    Finally, found this and much pleased.
    A great tutorial to work.
    Can we make this happen without using JS/jQuery ?

  • d689p

    I wonder how I can avoid conflicts between menu script and prototype.js?

  • Pingback: 10 More Responsive Navigation Solutions | Wordpress Webdesigner

  • Pingback: 10 More Responsive Navigation Solutions | PJExploration

  • Pingback: 10 More Responsive Navigation Solutions

  • John

    I am getting the following error:

    Uncaught TypeError: Cannot read the property clientWidth of ‘null’

    Any help would be greatly appreciated…

  • Pingback: Web Dezine » Create navigation bars with Responsive Web Design techniques

  • Pingback: Create navigation bars with Responsive Web Design techniques | SIMPLYGRAY

  • Pingback: Responsive Menu using CSS & jQuery | Complete Web 2.0

  • Warface

    Love it !

  • sajay

    good tutorial and nice result, but too much javascript

  • Jay
  • Dave Bar

    Is there a way to add some animation/easing into revealing the dropdowns (both desktop and mobile views). having the sub options visual open, instead of the quick show/hide would give a more contemporary and creative presentation.

  • Pingback: 60+ Responsive Web Design Tutorial Roundup – Spoil Your Mobile visitors! | Good Favorites

  • Pingback: | kimdongmin.kr

  • Jeff

    All though this may be a great tutorial the user experience is totally horific. You’re not able to see content change when you click an item in the menu. You have to scroll two screen lenghts down to see the content. It’s not easy to see where you are on the site and it’s an expand and collapse hell. This is not at all an optimal solution for creating a navigation that handles three layers of navigation.

  • guest

    We’re using ezrotator plugin under our menu. this plugin scrolls different images. in ie 9, the drop menu appears under the images. does anyone know how we can get the menu to appear over the image? http://www.dwuser.com/easyrotator/

  • Pingback: Адаптивная навигация для мобильного сайта – возможные решения задачиБлог: интернет, SEO, WordPress, CSS, HTML5

  • http://www.facebook.com/maja.janic.587 Maja Janic

    Nice tutorial.

    There is an issue i cant understand though and make it working.

    I would be needed more submenus, as there is a lot things to put.

    Example: Clothing > Men > Shoes > Sneakers > Nike > Running

    When i try to nest new ul and li inside 3rd submenu(Shoes > Womens > Sandals) it just shows up as soon as i hover “Womens” on the side, instead waiting me to hover over Sandals to open new submenu, and than to hover next open to open a next submenu, …

    And

    I just cant figure out this one, and how to make it working, so if anyone can help me about this, please do help me.

    Thanks in advance.

  • Alpesh

    i m using this menu but i have some problem with this so plz can u….
    how to toggle button left to right? wtih javascript
    & also i have to add add one more resolution size…

  • Pingback: Responsive Menus Tutorials

  • cape_codder_90

    Could you add support for more levels? I have tried to figure it out myself, but nothing I do is working properly. I integrated this with my client’s existing 4-level menu not realizing it only supported 3 levels.