JSFiddle - React, Tailwind, and code Playground
by kodisha
HTML
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Create a Awesome Vertical Tabbed Content Area using CSS3 & jQuery | FarDesign.net</title>
<!-- Include Styles -->
<link rel="stylesheet" href="assets/css/styles.css" />
<!--[if IE 7]><style type="text/css">#v-nav>ul>li.current{border-right:1px solid #fff!important}#v-nav>div.tab-content{z-index:-1!important;left:0}</style><![endif]-->
<!--[if IE 8]><style type="text/css">#v-nav>ul>li.current{border-right:1px solid #fff!important}#v-nav>div.tab-content{z-index:-1!important;left:0}</style><![endif]-->
</head>
<body>
<section id="wrapper" class="wrapper">
<h1 class="title">Apple iPhone 5</h1>
<div id="v-nav">
<ul>
<li tab="tab1" class="first current">Design</li>
<li tab="tab2">Specs</li>
<li tab="tab3">Price</li>
<li tab="tab4" class="last">Release Date</li>
<li tab="tab5" class="last">Tab 5</li>
<li tab="tab6" class="last">Tab 6</li>
<li tab="tab7" class="last">Tab 7</li>
<li tab="tab8" class="last">Tab 8</li>
<li tab="tab9" class="last">Tab 9</li>
<li tab="tab10" class="last">Tab 10</li>
<li tab="tab11" class="last">Tab 11</li>
<li tab="tab12" class="last">Tab 12</li>
</ul>
<div class="tab-content">
<h4>Design</h4>
</div>
<div class="tab-content">
<h4>Specs</h4>
</div>
<div class="tab-content">
<h4>Price</h4>
</div>
<div class="tab-content">
<h4>Release Date</h4>
</div>
<div...
CSS
body
{
background-color: #f7f7f7;
}
.wrapper
{
width: 960px;
margin: 0px auto;
padding-top: 20px;
min-height: 600px;
}
.wrapper h1, .wrapper h4, .wrapper p, .wrapper pre, .wrapper ul, .wrapper li
{
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
background: transparent;
}
.wrapper li
{
outline: 0;
text-decoration: none;
-webkit-transition-property: background color;
-moz-transition-property: background color;
-o-transition-property: background color;
-ms-transition-property: background color;
transition-property: background color;
-webkit-transition-duration: 0.12s;
-moz-transition-duration: 0.12s;
-o-transition-duration: 0.12s;
-ms-transition-duration: 0.12s;
transition-duration: 0.12s;
-webkit-transition-timing-function: ease-out;
-moz-transition-timing-function: ease-out;
-o-transition-timing-function: ease-out;
-ms-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
#v-nav
{
height: 100%;
margin: auto;
color: #333;
font: 12px/18px "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
}
#v-nav >ul
{
float: left;
width: 210px;
display: block;
position: relative;
top: 0;
border: 1px solid #DDD;
border-right-width: 0;
margin: auto 0 !important;
padding:0;
}
#v-nav >ul >li
{
width: 180px;
list-style-type: none;
display: block;
text-shadow: 0px 1px 1px #F2F1F0;
font-size: 1.11em;
position: relative;
border-right-width: 0;
border-bottom: 1px solid #DDD;
margin: auto;
padding: 10px 15px !important;
background: whiteSmoke; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f2f2f2 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f2f2f2)); /* Chrome,Safari4+ */
background:...
JavaScript
$(function () {
var items = $('#v-nav>ul>li').each(function () {
$(this).click(function () {
//remove previous class and add it to clicked tab
items.removeClass('current');
$(this).addClass('current');
//hide all content divs and show current one
$('#v-nav>div.tab-content').hide().eq(items.index($(this))).show('fast');
window.location.hash = $(this).attr('tab');
});
});
if (location.hash) {
showTab(location.hash);
}
else {
showTab("tab1");
}
function showTab(tab) {
$("#v-nav ul li:[tab=" + tab + "]").click();
}
// Bind the event hashchange, using jquery-hashchange-plugin
//$(window).hashchange(function () {
// showTab(location.hash.replace("#", ""));
//})
// Trigger the event hashchange on page load, using jquery-hashchange-plugin
//$(window).hashchange();
showTab('tab1');
});