Skip to content

Instantly share code, notes, and snippets.

@macdonst
Created November 29, 2012 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save macdonst/4166658 to your computer and use it in GitHub Desktop.
Save macdonst/4166658 to your computer and use it in GitHub Desktop.
Cordova OptionsMenu example
var onSettings = function() {
console.log("settings");
};
var onHelp = function() {
console.log("help");
};
var optionsmenu = new OptionsMenu({
id: "optionsmenu",
items: [
[ {
label: "Settings",
image: "menu/settings.png",
action: onSettings
},
{
label: "Help",
image: "menu/help.png",
action: onHelp
} ]
]
});
var optionsmenu = new OptionsMenu({
id: "optionsmenu",
items: [
[ {
label: "Settings",
image: "menu/settings.png",
action: onSettings
},
{
label: "Help",
image: "menu/help.png",
action: onHelp
} ],
[ {
label: "Row 2",
image: "menu/settings.png",
action: onHelp
} ],
[ {
label: "Row 3",
image: "menu/settings.png",
action: onSettings
},
{
label: "More Help",
image: "menu/help.png",
action: onHelp
},
{
label: "Even More Help",
image: "menu/help.png",
action: onHelp
} ],
],
});
<script type="text/javascript" charset="utf-8" src="OptionsMenu.js"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment