Created
February 10, 2014 08:28
-
-
Save anonymous/8912275 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.tab{float:left; width:32px; height:32px; background:#FFFFFF;} | |
.tab:hover{background:#F7F7F7;} | |
.tab.active{background:#01A1DC; color:#FFFFFF;} | |
.tab-content{display:none; float:left; width:300px; height:200px; background:#FFFFFF; border:1px solid #d8d5d6;} | |
.tab-content.active{display:block;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://jashkenas.github.com/coffee-script/extras/coffee-script.js"></script> | |
<meta charset=utf-8 /> | |
<title>Welcome to JS Bin</title> | |
<meta name="viewport" content="width=device-width"> | |
<link href='http://fonts.googleapis.com/css?family=Doppio+One' rel='stylesheet' type='text/css'> | |
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
</head> | |
<body> | |
<div class="drop-up"> | |
<div class="tab-content active">Content 1</div> | |
<div class="tab-content">Content 2</div> | |
<div class="tab-content">Content 3</div> | |
<div class="tab-content">Content 4</div> | |
<div class="tab-content">Content 5</div> | |
<div class="tab active">1</div> | |
<div class="tab">2</div> | |
<div class="tab">3</div> | |
<div class="tab">4</div> | |
<div class="tab">5</div> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.tab').click(function(){ | |
$('.tab, .tab-content').removeClass('active'); | |
$(this).addClass('active'); | |
var i = $(this).index('.drop-up .tab'); | |
$('.tab-content').eq(i).addClass('active'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment