Skip to content

Instantly share code, notes, and snippets.

@ebinnion
Created January 24, 2012 05:12
Show Gist options
  • Save ebinnion/1668122 to your computer and use it in GitHub Desktop.
Save ebinnion/1668122 to your computer and use it in GitHub Desktop.
Jquery Hide/Show Menu Responsive Web Design
$('#menu-button').click(function(){
$('.menu').slideToggle('fast',function() {});
});
function menuHide (){
if ($(window).width() < 1024){
$("body").addClass("mobile");
}
else {
$("body").removeClass("mobile");
}
}
menuHide(); // Triggers when document first loads
$(window).bind("resize",function() {
menuHide();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment