Created
December 9, 2016 19:33
-
-
Save heckctor/f4d0d649cdff5e6edf1e84cddec9a90b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<ul class="tabs"> | |
<li><a href="#tab-1">Tab1</a></li> | |
<li><a href="#tab-2">Tab2</a></li> | |
<li><a href="#tab-3">Tab3</a></li> | |
</ul> | |
<div id="tab-1" class="tabContent"> | |
Tab1 | |
</div> | |
<div id="tab-2" class="tabContent"> | |
Tab2 | |
</div> | |
<div id="tab-3" class="tabContent"> | |
Tab3 | |
</div> | |
<script type="text/javascript"> | |
$(".tabContent").hide(); | |
$("ul.tabs li:first").addClass("active").show(); | |
$(".tabContent:first").show(); | |
$("ul.tabs li").click(function () { | |
$("ul.tabs li").removeClass("active"); | |
$(this).addClass("active"); | |
$(".tabContent").hide(); | |
var activeTab = $(this).find("a").attr("href"); | |
$(activeTab).fadeIn(); | |
return false; | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment