-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.html
121 lines (109 loc) · 4.69 KB
/
examples.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<html>
<head>
<title>Custom jQuery Select</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="./dist/css/custom-select.css">
<!-- Used just to create example file. (Not necessary at all) -->
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="container custom-example">
<div class="row">
<form class="col-md-6 margin">
<h4>Example One:</h4>
<p>Simple use, just define the current select class:</p>
<select class="select-one">
<option value="select1-value1">Select one - Value 1</option>
<option value="select1-value2" selected="">Select one - Value 2</option>
<option value="select1-value3">Select one - Value 3</option>
</select>
</form>
<form class="col-md-6 margin">
<h4>Example Two:</h4>
<p>Adding a custom title to your select <em class="text-muted">(default - )</em>:</p>
<select class="select-two">
<option value="select2-value1">Select two - Value 1</option>
<option value="select2-value2">Select two - Value 2</option>
<option value="select2-value3">Select two - Value 3</option>
</select>
</form>
</div>
<div class="row">
<form class="col-md-6 margin">
<h4>Example Three:</h4>
<p>Changing click element <em class="text-muted">(default div)</em>:</p>
<select class="select-three">
<option value="select3-value1">Select three - Value 1</option>
<option value="select3-value2">Select three - Value 2</option>
<option value="select3-value3">Select three - Value 3</option>
</select>
</form>
<form class="col-md-6 margin">
<h4>Example Four:</h4>
<p>Animation speed <em class="text-muted">(default 100 - here using 600)</em>:</p>
<select class="select-four">
<option value="select4-value1">Select four - Value 1</option>
<option value="select4-value2">Select four - Value 2</option>
<option value="select4-value3">Select four - Value 3</option>
</select>
</form>
</div>
<div class="row">
<form class="col-md-6 margin" method="GET">
<h4>Example Five:</h4>
<p>Submit form when select an option and remove the submit button <em class="text-muted">(default false)</em>:</p>
<select class="select-five" name="select4">
<option value="select5-value1">Select five - Value 1</option>
<option value="select5-value2">Select five - Value 2</option>
<option value="select5-value3">Select five - Value 3</option>
</select>
<button type="submit">Submit</button>
</form>
<form class="col-md-6 margin">
<h4>Example Six:</h4>
<p>Search an option <em class="text-muted">using search attribute</em>:</p>
<select class="select-six">
<option value="select6-value1">Select six - A value to search</option>
<option value="select6-value2">Select six - Different text here</option>
<option value="select6-value3">Select six - What about an option</option>
<option value="select6-value4">Select six - Try to search some text</option>
<option value="select6-value5">Select six - Other content here</option>
</select>
</form>
</div>
</div>
<!-- Necessary jQuery instance file -->
<script src="https://code.jquery.com/jquery-3.2.1.min.js" crossorigin="anonymous"></script>
<!-- Custom select script file -->
<script src="./src/custom-select.js"></script>
<script>
// Default usage.
$('.select-one').customSelect();
// Adding a custom title to your select.
$('.select-two').customSelect({
defaultText: 'Select your option here'
});
// Changing element click.
$('.select-three').customSelect({
defaultElement: 'h5',
defaultText: 'Here is a H5 element select'
});
// Select animation speed.
$('.select-four').customSelect({
animationSpeed: 600
});
// Submit form when select an option.
$('.select-five').customSelect({
autoFormSubmit: true,
defaultText: 'Select an option to submit form'
});
// Adding a custom search to your select.
$('.select-six').customSelect({
searchField: true,
defaultText: 'Click here to search an option'
});
</script>
</body>
</html>