Skip to content

Instantly share code, notes, and snippets.

@maxcraftsman
Created May 24, 2018 08:02
Show Gist options
  • Save maxcraftsman/b571d715b161dee8195d4eb2dbd26969 to your computer and use it in GitHub Desktop.
Save maxcraftsman/b571d715b161dee8195d4eb2dbd26969 to your computer and use it in GitHub Desktop.
adaptive menu
function PackMenu(){
var menu = '#adaptive-menu';
$("#ext-menu").hide();
$(menu).append($("#ext-menu .ext-menu>li"));
while($(menu + ">li:last").position().top > $(menu).position().top){
$("#ext-menu .ext-menu").prepend($(menu + ">li:last"));
$("#ext-menu").show();
};
}
$(window).on("resize", function() {
if (Foundation.MediaQuery.atLeast('mobile')) {
$('#adaptive-menu').append($("#mobile-menu>*"));
PackMenu();
} else {
MobileMenu();
}
if($('div').is('.slider')){
$('.slider').foundation('_reflow');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment