Class wink.ui.xy.Menu
Displays an iPhone-like popup menu. You have to define the 1 to 6 items.
- Defined in: menu.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
wink.ui.xy.Menu(properties)
|
| Compatibility list | Supported platforms / browsers |
|---|---|
|
iOS2, iOS3, iOS4, iOS5, iOS6, Android 1.1, Android 1.5, Android 2.1, Android 2.2, Android 2.3, Android 3.0, Android 3.1, Android 4.0, BlackBerry 6, BlackBerry 7, Bada 1.0, Windows Phone 7.5, Windows Phone 8
|
Method Summary
Class Detail
wink.ui.xy.Menu(properties)
var menuProperties =
{
x: 20;
y: 20
}
var menu = new wink.ui.xy.Menu(menuProperties);
document.body.appendChild(menu.getDomNode());
menu.addItem(
{
itemClass: 'item1',
title: 'page1',
callback: { context: window, method: 'selectItem1' }
});
- Parameters:
- {object} properties
- The properties object
- {integer} properties.x
- The top position of the menu
- {integer} properties.y
- The left position of the menu
- See:
- Test page
Field Detail
{integer}
uId
Unique identifier
Method Detail
-
addItem(item)Adds an item to the menu
- Parameters:
- {object} item
- the item to add
- {string} item.itemClass
- The class associated to the item that allows css adjustment
- {string} item.title
- The title of the item
- {object|function} item.callback
- The callback action that will be invoked when selecting the item
-
destroy()Destroy the singleton
-
{HTMLElement} getDomNode()Returns the Menu dom node
- Returns:
- {HTMLElement} The main dom node
-
toggle()Hides / Displays the menu
Event Detail
The menu has been closed
The menu has been opened