-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
56 lines (56 loc) · 2.02 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>input-suggest</title>
<style>
body {
font-family: 'Roboto Mono';
}
input, textarea {
border: 1px solid #666;
width: 100%;
font-size: 24px;
font-family: 'Roboto Mono';
}
.container {
margin: 0 auto;
max-width: 960px;
}
.suggestion {
border: 1px solid #ccc;
padding: 0;
overflow: scroll;
}
.suggestion__item {
font-size: 24px;
background-color: #fff;
padding: 5px;
}
.suggestion__item:hover {
background-color: #cee;
}
.is-selected {
background-color: #eec;
}
</style>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto Mono:400,700">
</head>
<body>
<div class="container">
<h1><a>input-suggest</a></h1>
<p>Type Apple goods.</p>
<textarea rows="10"></textarea>
<p>Also works on input[type=text].</p>
<input type="text">
</div>
<a href="https://github.com/1000ch/input-suggest"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
<script src="dist/input-suggest.min.js"></script>
<script>
var textarea = new InputSuggest('textarea');
var input = new InputSuggest('input');
textarea.setSuggestions(['AirMac Express', 'Apple TV', 'Apple Watch', 'Mac Book Pro', 'Mac Book', 'iMac', 'iPad', 'iPad mini', 'iPhone', 'iPod', 'iPod Touch']);
input.setSuggestions(['AirMac Express', 'Apple TV', 'Apple Watch', 'Mac Book Pro', 'Mac Book', 'iMac', 'iPad', 'iPad mini', 'iPhone', 'iPod', 'iPod Touch']);
</script>
</body>
</html>