forked from wenzhixin/multiple-select
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyler.html
More file actions
44 lines (41 loc) · 1.01 KB
/
styler.html
File metadata and controls
44 lines (41 loc) · 1.01 KB
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
<script>
init({
title: 'the styler',
desc: 'Use <code>styler</code> to custom the item style',
links: ['multiple-select.css'],
scripts: ['multiple-select.js']
})
</script>
<style>
select {
width: 500px;
}
</style>
<select multiple="multiple">
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
<script>
function mounted() {
$('select').multipleSelect({
styler: function(value) {
if (value == '1') {
return 'background-color: #ffee00; color: #ff0000;';
}
if (value == '6') {
return 'background-color: #000; color: #fff;';
}
}
})
}
</script>