list check box

This bootstrap snippet called "list check box" was created to help web designers,
front-end developers and back-end developer save time. Use it in your project and build your app faster,
You can also download the HTML, CSS, and JS code

This is the HTML code for this bootstrap snippet

Copy, paste, change, customize and run the following HTML code to get a result like the one shown in the preview tab



     <div class="btn-group" data-toggle="buttons">   
        <label class="btn btn-success active">
    			<input type="checkbox" autocomplete="off" checked>
				<span class="glyphicon glyphicon-ok"></span>
                周國回
                <span class='badge'>12</span>
			</label>
        
       </div >
       
       
       <div class="well" style="max-height: 300px;overflow: auto;">
            	<ul class="list-group checked-list-box">
                  <li class="list-group-item"><input type="checkbox" class="hidden" /><span class="glyphicon glyphicon-unchecked"></span>周國回<span class='badge'>12</span></li>
                  <li class="list-group-item" data-checked="true"><input type="checkbox" class="hidden" /><span class="glyphicon glyphicon-check"></span>周國回<span class='badge'>12</span></li>
                  <li class="list-group-item">Morbi leo risus</li>
                  <li class="list-group-item">Porta ac consectetur ac</li>
                  <li class="list-group-item">Vestibulum at eros</li>
                  <li class="list-group-item">Cras justo odio</li>
                  <li class="list-group-item">Dapibus ac facilisis in</li>
                  <li class="list-group-item">Morbi leo risus</li>
                  <li class="list-group-item">Porta ac consectetur ac</li>
                  <li class="list-group-item">Vestibulum at eros</li>
                </ul>
            </div>
        

This is the CSS code for this bootstrap snippet

Copy, paste, change, customize and run the following CSS code to get a result Like the one shown in the preview



.btn span.glyphicon {        		
	opacity: 0;				
}
.btn.active span.glyphicon {				
	opacity: 1;				
}

/* CSS REQUIRED */
.state-icon {
    left: -5px;
}
.list-group-item-primary {
    color: rgb(255, 255, 255);
    background-color: rgb(66, 139, 202);
}

/* DEMO ONLY - REMOVES UNWANTED MARGIN */
.well .list-group {
    margin-bottom: 0px;
}
                                    

This is the JS code for this bootstrap snippet

Copy, paste, change, customize and run the following JS code to get a result Like the one shown in the preview


$(function () {
    $('.list-group.checked-list-box .list-group-item').click(function () {
       $(this).attr("class", "list-group-item list-group-item-primary");
       var item1 = $( "span" )[0];
       $(this).find("span").first().attr("class", "glyphicon glyphicon-check");
    });
    
   
}); 

Information about this bootstrap snippet

Creator: chang sonne

Bootstrap version: 3.3.6

Created: Apr 25th 2016, 04:29

Views: 625