JSFiddle - React, Tailwind, and code Playground
by mavdhana
HTML
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<div ng-app="TabsApp">
<div id="tabs" ng-controller="TabsCtrl">
<ul>
<li ng-repeat="tab in tabs" ng-class="{active:isActiveTab(tab.url)}" ng-click="onClickTab(tab)">{{tab.title}}</li>
</ul>
<div id="mainView">
<div ng-include="currentTab"></div>
</div>
</div>
<script type="text/ng-template" id="one.tpl.html">
<div id="viewOne">
<p>Tab One</p>
</div>
</script>
<script type="text/ng-template" id="three.tpl.html">
<div id="viewThree" ng-show="tab3==0">
<p>Tab Three</p>
<button type="button" class="btn btn-default" ng-click="next()">Next</button>
</div>
<div id="viewTesting" ng-show="tab3==1">
<p>Tab Three-Testing</p>
<p>Testing content</p>
<button type="button" class="btn btn-default" ng-click="prev()">Prev</button>
<button type="button" class="btn btn-default" ng-click="next()">Next</button>
</div>
<div id="viewSecondTesting" ng-show="tab3==2">
<p>This is second testing</p>
<button type="button" class="btn btn-default" ng-click="prev()">Prev</button>
<button type="button" class="btn btn-default" ng-click="next()">Next</button>
</div>
<div id="viewThirdTesting" ng-show="tab3==3">
<p>This is third testing</p>
<div class="accordion vertical">
<ul>
<li>
<input type="checkbox" id="checkbox-1" name="checkbox-accordion" />
<label for="checkbox-1">Test1</label>
<div class="content">
<p>Test1 Content</p>
</div>
</li>
<li>
<input type="checkbox"...
CSS
.accordion {
font-family:Arial, Helvetica, sans-serif;
margin:0 auto;
font-size:14px;
border:1px solid #542437;
border-radius:10px;
width:600px;
padding:10px;
background:#fff;
}
.accordion ul {
list-style:none;
margin:0;
padding:0;
}
.accordion li {
margin:0;
padding:0;
}
.accordion [type=radio], .accordion [type=checkbox] {
display:none;
}
.accordion label {
display:block;
font-size:16px;
line-height:16px;
background:lightblue;
border:1px solid #542437;
color:black;
text-shadow:1px 1px 1px rgba(255,255,255,0.3);
font-weight:700;
cursor:pointer;
text-transform:uppercase;
-webkit-transition: all .2s ease-out;
-moz-transition: all .2s ease-out;
}
.accordion ul li label:hover, .accordion [type=radio]:checked ~ label, .accordion [type=checkbox]:checked ~ label {
background:gray;
color:#FFF;
text-shadow:1px 1px 1px rgba(0,0,0,0.5)
}
.accordion .content {
padding:0 10px;
overflow:hidden;
border:1px solid #fff;
-webkit-transition: all .5s ease-out;
-moz-transition: all .5s ease-out;
}
.accordion p {
color:#333;
margin:0 0 10px;
}
.accordion h3 {
color:#542437;
padding:0;
margin:10px 0;
}
.vertical ul li {
overflow:hidden;
margin:0 0 1px;
}
.vertical ul li label {
padding:10px;
}
.vertical [type=radio]:checked ~ label, .vertical [type=checkbox]:checked ~ label {
border-bottom:0;
}
.vertical ul li label:hover {
border:1px solid #542437;
}
.vertical ul li .content {
height:0px;
border-top:0;
}
.vertical [type=radio]:checked ~ label ~ .content, .vertical [type=checkbox]:checked ~ label ~ .content {
height:300px;
border:1px solid #542437;
}
ul {
list-style: none;
padding: 0;
margin: 0;
}
li {
float: left;
border: 1px solid #000;
border-bottom-width: 0;
margin: 3px 3px 0px 3px;
padding: 5px 5px 0px 5px;
background-color: #CCC;
color:...
JavaScript
angular.module('TabsApp', [])
.controller('TabsCtrl', ['$scope', '$location', function($scope, $location) {
$scope.tabs = [{
title: 'One',
url: 'one.tpl.html'
}, {
title: 'Three',
url: 'three.tpl.html'
}];
$scope.currentTab = 'one.tpl.html';
$scope.onClickTab = function(tab) {
$scope.currentTab = tab.url;
}
$scope.isActiveTab = function(tabUrl) {
return tabUrl == $scope.currentTab;
}
$scope.tab3 = 0;
$scope.next = function() {
$scope.tab3 = $scope.tab3 + 1;
}
$scope.prev = function() {
$scope.tab3 = $scope.tab3 - 1;
}
}]);