xxxxxxxxxx
1
<div class="row mt-5">
2
<div class="col-md-6 select-outline">
3
4
<select id="select1" class="mdb-select md-form md-outline colorful-select dropdown-primary">
5
<option value="" disabled selected>Choose your option</option>
6
<option value="1">Option 1</option>
7
<option value="2">Option 2</option>
8
<option value="3">Option 3</option>
9
</select>
10
<label for="select1">Example label</label>
11
12
</div>
13
<div class="col-md-6 select-outline">
14
15
<select id="select2" class="mdb-select md-form md-outline colorful-select dropdown-primary">
16
<option value="" disabled selected>Choose your option</option>
17
<option value="1">Option 1</option>
18
<option value="2">Option 2</option>
19
<option value="3">Option 3</option>
20
</select>
21
<label for="select2">Example label</label>
22
23
</div>
24
</div>
25
26
<div class="row mt-5">
27
<div class="col-md-12 select-outline">
28
29
<select id="select1" class="mdb-select md-form md-outline colorful-select dropdown-primary">
30
<option value="" disabled selected>Choose your option</option>
31
<option value="1">Option 1</option>
32
<option value="2">Option 2</option>
33
<option value="3">Option 3</option>
34
</select>
35
<label for="select1">Example label</label>
36
37
</div>
38
<div class="col-md-12 select-outline">
39
40
<select id="select2" class="mdb-select md-form md-outline colorful-select dropdown-primary">
41
<option value="" disabled selected>Choose your option</option>
42
<option value="1">Option 1</option>
43
<option value="2">Option 2</option>
44
<option value="3">Option 3</option>
45
</select>
46
<label for="select2">Example label</label>
47
48
</div>
49
</div>
xxxxxxxxxx
1
.md-outline.select-wrapper+label {
2
top: .5em !important;
3
z-index: 2 !important;
4
}
xxxxxxxxxx
1
// Material Select Initialization
2
$(document).ready(function() {
3
$('.mdb-select').materialSelect();
4
$('.select-wrapper.md-form.md-outline input.select-dropdown').bind('focus blur', function () {
5
$(this).closest('.select-outline').find('label').toggleClass('active');
6
$(this).closest('.select-outline').find('.caret').toggleClass('active');
7
});
8
});
Console errors: 0