JSFiddle - React, Tailwind, and code Playground
by woozyking
HTML
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<div class="container side-tab-panel">
<div class="row">
<div class="side-tab-header">
something
</div>
<div class="col-sm-2 col-xs-12 side-tab-menu">
<div class="list-group">
<a href="#" class="list-group-item active text-center">
<h4 class="glyphicon glyphicon-plane"></h4>
<br/>Flight
</a>
<a href="#" class="list-group-item text-center">
<h4 class="glyphicon glyphicon-road"></h4>
<br/>Train
</a>
<a href="#" class="list-group-item text-center">
<h4 class="glyphicon glyphicon-home"></h4>
<br/>Hotel
</a>
</div>
</div>
<div class="col-sm-10 col-xs-12 side-tab">
<!-- flight section -->
<div class="side-tab-content active">
<center>
<h1 class="glyphicon glyphicon-plane" style="font-size:14em;color:#55518a"></h1>
<h2 style="margin-top: 0;color:#55518a">Cooming Soon</h2>
<h3 style="margin-top: 0;color:#55518a">Flight Reservation</h3>
</center>
</div>
<!-- train section -->
<div class="side-tab-content">
<center>
<h1 class="glyphicon glyphicon-road" style="font-size:12em;color:#55518a"></h1>
<h2 style="margin-top: 0;color:#55518a">Cooming Soon</h2>
<h3 style="margin-top: 0;color:#55518a">Train Reservation</h3>
</center>
</div>
<!-- hotel search -->
<div class="side-tab-content">
<center>
<h2 style="margin-top: 0;color:#55518a">Cooming Soon</h2>
<h3 style="margin-top: 0;color:#55518a">Hotel Directory</h3>
</center>
</div>
</div>
</div>
</div>
<div class="container side-tab-panel">
<div class="row">
<div class="side-tab-header">
something
</div>
...
CSS
/* side tab */
div.side-tab-panel {
z-index: 10;
}
div.side-tab-header {
background-color: #eee;
border: 1px solid #ddd;
margin-right: 1px;
padding: 10px;
}
div.side-tab-menu {
padding-left: 0;
padding-right: 0;
margin-right: -1px;
z-index: 12;
}
div.side-tab-menu div.list-group {
margin-bottom: 0 !important;
}
div.side-tab-menu div.list-group>a {
margin-bottom: 0 !important;
background-color: #eee;
border-bottom: 1px solid #ddd;
}
div.side-tab-menu div.list-group>a:first-child{
border-radius: 0;
-moz-border-radius: 0;
/*border-top: 0;*/
}
div.side-tab-menu div.list-group>a:last-child{
border-radius: 0;
-moz-border-radius: 0;
}
div.side-tab-menu div.list-group>a.active {
background-color: #fff;
background-image: #fff;
color: #000;
border-right-width: 0;
border-color: #ddd;
}
div.side-tab {
-webkit-border-bottom-right-radius: 7px;
-webkit-border-bottom-left-radius: 7px;
-moz-border-bottom-right-radius: 7px;
-moz-border-bottom-left-radius: 7px;
border-bottom-right-radius: 7px;
border-bottom-left-radius: 7px;
border: 1px solid #ddd;
/*border-left: 1px solid #ddd;
border-right: 1px solid #ddd;
border-bottom: 1px solid #ddd;*/
/*-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
box-shadow: 0 6px 12px rgba(0,0,0,.175);
-moz-box-shadow: 0 6px 12px rgba(0,0,0,.175);*/
}
div.side-tab-content {
min-height: 240px;
background-color: #ffffff;
}
div.side-tab div.side-tab-content:not(.active) {
display: none;
}
JavaScript
// TODO make this work with bootstrap's built-in tab mechanism
$(document).ready(function() {
$("div.side-tab-menu>div.list-group>a").click(function(e) {
e.preventDefault();
$(this).siblings('a.active').removeClass("active");
$(this).addClass("active");
var index = $(this).index();
$("div.side-tab>div.side-tab-content").removeClass("active");
$("div.side-tab>div.side-tab-content").eq(index).addClass("active");
});
});