"Bootstrap Checklist"
Bootstrap 3.3.0 Snippet by LuxDigital

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
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<p>This demo uses a min of 3 and max of 5 selections along with a callback to alert the selected values.</p>
</div>
<div class="container">
<a href="#" class="fetch-values pull-right">Fetch values</a>
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Your skills
<span class="caret"></span></button>
<ul id="my-checklist" class="dropdown-menu checklist">
<li data-value="JS" class="checked"><a href="#">Vanilla JS</a></li>
<li data-value="Node" class="checked"><a href="#">Node.js</a></li>
<li data-value="jQuery" class="checked"><a href="#">jQuery</a></li>
<li data-value="Bootstrap"><a href="#">Twitter Bootstrap</a></li>
<li data-value="PHP" class="checked"><a href="#">Vanilla PHP</a></li>
<li data-value="Drupal"><a href="#">Drupal</a></li>
<li data-value="Larvel"><a href="#">Larvel</a></li>
<li data-value="Symfony"><a href="#">Symfony</a></li>
<li data-value="Composer"><a href="#">Composer</a></li>
<li role="separator" class="divider"></li>
<li class="text-center small alert-values"><a href="#">Alert values</a></li>
<li role="separator" class="divider"></li>
<li class="text-center small dd-close"><a href="#">Close menu</a></li>
</ul>
</div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
/* allow check marks on drop down menu */
ul.dropdown-menu li.active,
ul.dropdown-menu li.checked {
/* aliases of each other */
}
ul.dropdown-menu li.active a:before,
ul.dropdown-menu li.checked a:before {
/* aliases of each other */
content: "\e013";
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
text-decoration: inherit;
/*--adjust as necessary--*/
color: rgb(92, 184, 92);
font-size: 18px;
padding-right: 0.5em;
}
/* basic styli`ng */
.container:first-of-type {
margin-top: 50px;
}
.container:last-of-type {
margin-top: 50px;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
/*************************************************************
* jQuery + Bootstrap Checklist
* Last updated January 22, 2017 2:45pm EST
* Version 0.1.0 : Created January 21, 2017
* Developed by M. Daniel Lindsey dba LuxDigital
*************************************************************/
/*************************************************************
* Upcoming Features
** no new features requested or planned
*************************************************************/
/*************************************************************
* Table of Contents
* 1. Class & element references
* 2. Plugin definition
* 3. Option handling
* 4. Click handling for `li` elements
* 5. Plugin defaults
* 6. Preliminary check for auto-init instances (disabled)
*************************************************************/
/*************************************************************
* 1. Class & element references
*************************************************************/
var ChecklistParentDropdownSelector, ChecklistActiveClassName, ChecklistStyleClassName, ChecklistValueSeparator;
ChecklistParentDropdownSelector = 'ul.dropdown-menu';
ChecklistStyleClassName = ''; // custom class name for the base `ul` element if you wish to use your own CSS rules
ChecklistActiveClassName = 'checked'; // must match the default (checked) or your style rules
ChecklistValueSeparator = ','; // comma by default, can be anything you like
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: