Skip to content

Instantly share code, notes, and snippets.

@poonkave
Last active December 14, 2015 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poonkave/5109471 to your computer and use it in GitHub Desktop.
Save poonkave/5109471 to your computer and use it in GitHub Desktop.
$(document).on('pageinit', '#home', function () {
// code
var _menuLoaded = false;
$('#menuPanel').load('menu.html', function () {
$(this).find(":jqmData(role=listview)").listview();
$(this).trigger("updatelayout");
$.mobile.loading("hide");
_menuLoaded = true;
});
$("#menuPanel").on("panelopen", function (event, ui) {
if (!_menuLoaded) {
$.mobile.loading("show");
return;
}
$("#menuPanel").off("panelopen");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment