JQuery Mobile Menu on Android menu button -
i'm developing small hybrid app using phonegap in android. want menu popped native app on press of menu hardware button on android phone. im using galaxy s2. did try creating div , toggling on menubutton.
$(document).on("menubutton", onmenubutton); function onmenubutton(){ $("#sltmainmenu").toggle(); }
and div not part of page.
<div id="main_menu" data-role="fieldcontain" class="mainmenu"> <select name="sltmainmenu" id="sltmainmenu" data-native-menu="false"> <option value="search">search</option> <option value="logout">logout</option> </select> </div>
how achieve native app menu action using phonegap?
you want add script document's head:
document.addeventlistener("menubutton", menubuttonhandle, false); function menubuttonhandle() { alert("menu button pressed!"); }
for more information , examples, see
http://docs.phonegap.com/en/3.4.0/cordova_events_events.md.html#menubutton
Comments
Post a Comment