forked from ricardojlrufino/jui_dropdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
104 lines (78 loc) · 2.45 KB
/
demo.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>jui_dropdown - jQuery dropdown menu plugin</title>
<!-- jui_dropdown -->
<link id="ui-theme" rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.0/themes/ui-lightness/jquery-ui.css"/>
<link rel="stylesheet" type="text/css" href="jquery.jui_dropdown.css"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.min.js" type="text/javascript"></script>
<script src="jquery.jui_dropdown.js" type="text/javascript"></script>
</head>
<body>
<div>
<button id="launcher4">Select Icon</button>
<ul>
<li id="opt_4.1"><a href="javascript:void(0);">Option-4.1</a></li>
<li id="opt_4.2"><a href="javascript:void(0);">Option-4.2</a></li>
<li id="opt_4.3"><a href="javascript:void(0);">Option-4.3</a></li>
</ul>
</div>
<div style="height: 500px;background-color: #c2c2c2">
<h1>Spacing test..</h1><br/>
Result: <div id="result"></div>
<br/>
<hr/>
OLD WAY CODE:
<div id="demo_drop2">
<div id="launcher2_container">
<button id="launcher2">Select another</button>
</div>
<ul id="menu2">
<li id="opt_2.1"><a href="javascript:void(0);">Option-2.1</a></li>
<li id="opt_2.2"><a href="javascript:void(0);">Option-2.2</a></li>
<hr>
<li id="opt_2.3"><a href="javascript:void(0);">Option-2.3</a></li>
</ul>
</div>
</div>
<div>
<button class="btn-drop">Select byClass 1</button>
<ul>
<li><a href="javascript:void(0);">Option-1.1</a></li>
<li><a href="javascript:void(0);">Option-1.2</a></li>
<hr>
<li><a href="javascript:void(0);">Option-1.3</a></li>
</ul>
</div>
<div>
<button class="btn-drop">Select byClass 2</button>
<ul>
<li><a href="javascript:void(0);">Option-2.1</a></li>
<li><a href="javascript:void(0);">Option-2.2</a></li>
<hr>
<li><a href="javascript:void(0);">Option-2.3</a></li>
</ul>
</div>
<script>
$(function() {
// many buttons test.
$('.btn-drop').jui_dropdown({
launcher_is_UI_button: false,
onSelect: showSelected
});
$('#launcher4').jui_dropdown({
launcherUIShowText: false,
launcherUISecondaryIconClass: 'ui-icon-gear',
my_position: 'right top',
at_position: 'right bottom',
onSelect: showSelected
});
});
function showSelected(event, data){
$("#result").text($(event.target).text() + ' - index: ' + data.index + ' (id: ' + data.id + ')');
}
</script>
</body>
</html>