Build Menu Dynamically


Menucool Tab Menu has a built-in function, init(), that helps building the menu on the fly, or change the menu markup at any time you want.

This demo provides an example of building the tab menu dynamically through jQuery Ajax.

Clicking on each of the buttons above will trigger a jQuery Ajax call to retrieve the menu HTML markup. The callback function of the Ajax will populate the menu's HTML, and then call the tabmenu.init(); to initiate the menu.

function initMenu1() { $.ajax("markup.txt").done( function (data) { $("#placeHolder1").html(data); tabmenu.init(); } ); }

Please view the source of this HTML page for details.