Punch! Menu
[raw]
function updateMenuSize() {
var menuContainer = $(“#menuContainer”);
var width = Math.floor(menuContainer.parent().width());
if (width === menuContainer.width()) {
return;
}
var height = Math.floor(width * (1232 / 800) + 40);
// NEW: If both the “classificationId” and “menuId” are passed, then make things a bit taller on small screens
if(width <= 600) {
height += 24;
}
menuContainer.width(width);
$("#menuFrame")
.width(width)
.height(height)
.attr("src", "https://app.menuvative.com/embed/1.0/menu?classificationId=248&width=" + width);
}
// When the page is first loaded or window is resized, ensure the menu is in the correct size
$(updateMenuSize);
$(window).resize(updateMenuSize);
[/raw]