-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
77 lines (74 loc) · 2.85 KB
/
example.html
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
<head>
<title>jQuery-menubar Example</title>
<meta charset="UTF-8" />
<link href="menubar.css" type="text/css" rel="stylesheet">
<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-2.2.1.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script src="jquery-menubar.js"></script>
<script>
$(document).ready(function(){
test = {
help: function(e){
$('#log').prepend('<div>Show help</div>');
}
};
$('#menubar').menubar({
items: {
mnuMain:{
label : 'Main',
submenu : {
mnuFileNew: {
label : 'New',
action : function(){
$('#log').prepend('<div>Create new file</div>');
}
}
}
},
mnuWhateverIWant: {
label : 'Any name I wish',
submenu : {
mnuWhateverOne: {
label : 'This is submenu',
submenu : {
mnuWhateverOneSub: {
label : 'Look there is something',
},
mnuWhateverOne2: {
label : 'Menu item'
},
}
}
}
},
mnuHelp: {
label : 'Help',
action : test.help
}
}
});
});
</script>
<style>
#log {
position: absolute;
top: 50px;
width: 300px;
height: 400px;
overflow: auto;
border: 1px solid #000;
padding: 10px;
}
#log div:first-child {
font-weight: bold;
}
</style>
</head>
<body>
<div id="menubar"></div>
<div id="log"></div>
</body>
</html>