-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdemo.html
82 lines (80 loc) · 2.5 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
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>jquery.customSelect</title>
<link rel="stylesheet" href="src/jquery.customSelect.css" />
<style type="text/css">
body {
font-family: "Helvetica Neue", "Lucida Grande", "Arial";
background: #F8F8F8;
background: #ECE9E9 -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#ECE9E9)) no-repeat;
background: #ECE9E9 -moz-linear-gradient(top, #fff, #ECE9E9) no-repeat;
color: #555;
font-size: 12px;
-webkit-text-stroke: 1px rgba(255, 255, 255, 0.1);
}
.container {
width: 200px;
padding: 20px;
margin: 20px;
float: left;
}
</style>
</head>
<body>
<div class="container">
<h2>A standard select</h2>
<select id="singleSelect">
<option value="cola">A glass of cola</option>
<option selected value="lemonade">A class of lemonade</option>
<option value="tea">A cup of tea</option>
</select>
</div>
<div class="container">
<h2>A multi select</h2>
<select id="multipleSelect" multiple>
<option value="cake">A tasty cake</option>
<option value="burger">A fatty burger</option>
<option value="cola">A large cola</option>
</select>
</div>
<div class="container">
<h2>A custom-range select</h2>
<select id="rangeSelect">
<option value="1p">1+ bedrooms</option>
<option value="2p">2+ bedrooms</option>
<option value="3p">3+ bedrooms</option>
</select>
</div>
<div class="container">
<h2>A custom-value select</h2>
<select id="valueSelect">
<option value="100">$100</option>
<option value="200">$200</option>
<option value="300">$300</option>
</select>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script src="src/jquery.customSelect.js"></script>
<script>
$('#singleSelect, #multipleSelect').customSelect();
$('#rangeSelect').customSelect({
customRange: true,
windowFormatter: function (value) {
if (value.indexOf('bedrooms') === -1) {
value += ' bedrooms';
}
return value.replace(/bedrooms/, '<strong>bedrooms</strong>');
}
});
$('#valueSelect').customSelect({
customValue: true,
windowFormatter: function (value) {
return '$ <strong>' + value.replace(/^\$/, '') + '</strong>';
}
});
</script>
</body>
</html>