-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
93 lines (84 loc) · 2.24 KB
/
index.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
<html>
<head>
<script src="lib/js/jquery-1.6.2.min.js"></script>
<script src="lib/js/jquery-ui-1.8.16.custom.min.js"></script>
<script src="magicomplete.js"></script>
<link rel="stylesheet" href="lib/css/ui-lightness/jquery-ui-1.8.16.custom.css" media="all" type="text/css" />
<style>
.ui-autocomplete-category {
font-weight: bold;
padding: .2em .4em;
margin: .8em 0 .2em;
line-height: 1.5;
}
.ui-menu-item a {
padding-left: 20px !important;
}
.close {
float: right;
color: #000000;
font-size: 20px;
font-weight: bold;
line-height: 13.5px;
text-shadow: 0 1px 0 #ffffff;
filter: alpha(opacity=20);
-khtml-opacity: 0.2;
-moz-opacity: 0.2;
opacity: 0.2;
text-decoration: none;
}
.close:hover {
color: #000000;
text-decoration: none;
filter: alpha(opacity=40);
-khtml-opacity: 0.4;
-moz-opacity: 0.4;
opacity: 0.4;
}
.magicomplete ul {
position: relative;
}
.magicomplete ul li {
display: block;
float: left;
border: 1px solid #000;
padding: 8px;
}
.magicomplete ul li span {
float: right;
color: #666;
font-size: 0.8em;
}
</style>
<script>
$(document).ready(function() {
$('.magicomplete').magicomplete({
selected: [
{ label: "Atlanta, GA", category: "Location" },
{ label: "Soccer", category: "Interest" }
],
data: [
{ label: "Atlanta, GA", category: "Location" },
{ label: "Atlanta, AK", category: "Location" },
{ label: "Atlanta Falcons", category: "Interest" },
{ label: "Atlanta Jones", category: "Person" },
{ label: "Atlanta Smith", category: "Person" },
]
});
$('#clicker').click(function() {
$.each($('.magicomplete').magicomplete('value'), function(index, value) {
$('#values').append('[label: "' + value.label + '", category: "' + value.category + '"]')
});
$('#values').append('<br />');
});
});
</script>
</head>
<body>
<h1>Magicomplete</h1>
<div class="magicomplete"></div>
<br style="clear: both;"/>
<button id="clicker">log value</button>
<div id="values"></div>
</body>
</html>