"Selected Div Example"
Bootstrap 3.3.0 Snippet by webenlance

<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"> <div class="row"> <h2>All the Snippets by Webenlance are free to use just copy paste and enjoy</h2> </div> </div> <div class="menu_button">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliqum erat volutpat</div> <div class="menu_button">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliqum erat volutpat</div> <div class="menu_button">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliqum erat volutpat</div> <div class="menu_button">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliqum erat volutpat</div>
.menu_button { padding: 10px 20px 10px 20px; position: relative; color: #666; float: left; border-left: 1px dotted #e5e5e5; font-size: 14px; cursor: pointer; } .menu_button:hover { color: #f26d7d; } .menu_button:active { color: #ccc; } .menu_button.selected { background-color: #ccc; }
$(document).ready(function(){ $('.menu_button').click(function() { $(this).addClass('selected').siblings().removeClass('selected') }); });

Related: See More


Questions / Comments: