PhotonUI logo

PhotonUI

A javascript framework to create user interfaces

Menu

photonui.Menu is a basic layout that is only meant to contain photonui.MenuItem, photonui.SubMenuItem and other photonui.Menu widgets.

Class Reference

More examples

With a submenu

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
var menu = new photonui.Menu({
iconVisible: true,
children: [
new photonui.MenuItem({
text: "Menu Item 1",
icon: new photonui.FAIcon("fa-paper-plane"),
callbacks: {
click: function(widget, event) {
alert("You clicked on me!");
}
}
}),
new photonui.MenuItem({
text: "Menu Item 2",
icon: new photonui.FAIcon("fa-gears")
}),
new photonui.SubMenuItem({
text: "Menu Item 3",
menuName: "submenu1",
icon: new photonui.FAIcon("fa-paw")
}),
new photonui.Menu({
visible: true, // false to hide it by default
name: "submenu1",
iconVisible: true,
children: [
new photonui.MenuItem({
text: "Submenu Item 1",
icon: new photonui.FAIcon("fa-gamepad")
}),
new photonui.MenuItem({
text: "Sumbenu Item 2",
icon: new photonui.FAIcon("fa-flask")
})
]
}),
new photonui.MenuItem({
text: "Menu Item 2",
icon: new photonui.FAIcon("fa-eye")
}),
]
});

photonui.domInsert(menu, "demo");