I am trying to use jquery mobile panels for navigation menu in my app, this menu appears when you click on the menu button on pages, from the doc, I understand that I should add this menu panel to every page.
Since my pages are also added at run time, I need someway to inject the menu panel into the page when it is created, I'm using following code which is not working:
var $menuElement = $("#menu");
if ($activePage.find($menuElement).length <= 0) {
console.log("Adding menu");
$menuElement.show().css({height:$(".fb-menu").find("li").size() * 5 + "px"});
$menuElement.prependTo($activePage);
$activePage.trigger('create');
$activePage.trigger('update');
}
anyone has an idea how should I add my menu panel to a page which is added dynamically?