Skip to content

Instantly share code, notes, and snippets.

@jasonlfunk
Created June 2, 2014 18:08
Show Gist options
  • Save jasonlfunk/2e7cd52814669aec561c to your computer and use it in GitHub Desktop.
Save jasonlfunk/2e7cd52814669aec561c to your computer and use it in GitHub Desktop.
Automatically close Foundation5 off-canvas menu when resizing
$(document).ready(function() {
var $offCanvasWrap = $(".off-canvas-wrap");
$(window).resize(function() {
if(this.outerWidth > 640 && $offCanvasWrap.hasClass("move-right")) {
$(".exit-off-canvas").trigger("click");
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment