"BPSL Ajax Content"
Bootstrap 3.3.0 Snippet by lankadesk3

<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 ----------> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <div class="container"> <div class="row"> <h2>Create your snippet's HTML, CSS and Javascript in the editor tabs</h2> </div> <div class="row"> <div class="col-xs-4" data-target = '1-content'> post 1 </div> <div class="col-xs-4" data-target = '2-content'> post 2 </div> <div class="col-xs-4" data-target = '3-content'> post 3 </div> </div> <div class='row'> <div class='col-xs-12 explanation 1-content'>Post 1 description</div> <div class='col-xs-12 explanation hidden 2-content'>Post 2 description</div> <div class='col-xs-12 explanation hidden 3-content'>Post 3 description</div> </div> <div class="row"> <div class="col-xs-4" data-target = '4-content'> post 4 </div> <div class="col-xs-4" data-target = '5-content'> post 5 </div> <div class="col-xs-4" data-target = '6-content'> post 6 </div> </div> <div class='row'> <div class='col-xs-12 explanation hidden 4-content'>Post 4 description</div> <div class='col-xs-12 explanation hidden 5-content'>Post 5 description</div> <div class='col-xs-12 explanation hidden 6-content'>Post 6 description</div> </div> </div>
$('.col-xs-4').click(function(e){ var $target = $(e.currentTarget); $('.explanation').hide(); var targetClass = $target.attr('data-target'); $('.'+targetClass).removeClass('hidden').hide().fadeIn(); });

Related: See More


Questions / Comments: