Skip to content

Instantly share code, notes, and snippets.

@motorcitymobi
Last active December 18, 2015 00:08
Show Gist options
  • Save motorcitymobi/5693956 to your computer and use it in GitHub Desktop.
Save motorcitymobi/5693956 to your computer and use it in GitHub Desktop.
Responsive Navigation, inspired by the technique used in Brad Frost's Mobile-First Demo (http://bradfrostweb.com/demo/mobile-first/).
$(document).ready(function() {
$('body').addClass('js');
var $menu = $('#nav'),
$search = $('.search-bar'),
$menulink = $('.menu-link'),
$searchlink = $('.search-link');
$menulink.click(function() {
$menulink.toggleClass('active');
$searchlink.removeClass('active');
$menu.toggleClass('active');
$search.removeClass('active');
return false;
});
$searchlink.click(function() {
$menulink.removeClass('active');
$searchlink.toggleClass('active');
$menu.removeClass('active');
$search.toggleClass('active');
return false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment