forked from mtkopone/zelect
-
Notifications
You must be signed in to change notification settings - Fork 2
/
demo.html
100 lines (98 loc) · 2.58 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
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="./zelect.js"></script>
<link rel="stylesheet" href="http://css.cdn.tl/normalize.css" />
<style>
body { font-size: 16px; color: #1e1f19; background-color: #f3f3f3; padding: 10px 20px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
h2, h3, h4 { color: #464646; }
section { margin-bottom: 40px; }
section:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
#intro .zelect {
display: inline-block;
background-color: white;
min-width: 300px;
cursor: pointer;
line-height: 36px;
border: 1px solid #dbdece;
border-radius: 6px;
position: relative;
}
#intro .zelected {
font-weight: bold;
padding-left: 10px;
}
#intro .zelected.placeholder {
color: #999f82;
}
#intro .zelected:hover {
border-color: #c0c4ab;
box-shadow: inset 0px 5px 8px -6px #dbdece;
}
#intro .zelect.open {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
#intro .dropdown {
background-color: white;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border: 1px solid #dbdece;
border-top: none;
position: absolute;
left:-1px;
right:-1px;
top: 36px;
z-index: 2;
padding: 3px 5px 3px 3px;
}
#intro .dropdown input {
font-family: sans-serif;
outline: none;
font-size: 14px;
border-radius: 4px;
border: 1px solid #dbdece;
box-sizing: border-box;
width: 100%;
padding: 7px 0 7px 10px;
}
#intro .dropdown ol {
padding: 0;
margin: 3px 0 0 0;
list-style-type: none;
max-height: 150px;
overflow-y: scroll;
}
#intro .dropdown li {
padding-left: 10px;
}
#intro .dropdown li.current {
background-color: #e9ebe1;
}
#intro .dropdown .no-results {
margin-left: 10px;
}
</style>
<script>
$(setup)
function setup() {
$('#intro select').zelect({ placeholder:'Plz select...' })
}
</script>
</head>
<body>
<section id="intro">
<h2>$('select').zelect()</h2>
<select>
<option>I really have</option>
<option>to think of some</option>
<option>significantly more</option>
<option>relevant example data</option>
<option>here.</option>
<option>Also, need more and longer items</option>
<option>to demo scroll</option>
</select>
</section>
</body>
</html>