-
-
Save trof808/433de3b65c93b47dc5a2f1706f2391ca to your computer and use it in GitHub Desktop.
jQuery Tabs Short
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
.wrapper .active { | |
color: red; | |
} |
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
<div class="wrapper"> | |
<div class="tabs"> | |
<span class="tab">Вкладка 1</span> | |
<span class="tab">Вкладка 2</span> | |
<span class="tab">Вкладка 3</span> | |
</div> | |
<div class="tab_content"> | |
<div class="tab_item">Содержимое 1</div> | |
<div class="tab_item">Содержимое 2</div> | |
<div class="tab_item">Содержимое 3</div> | |
</div> | |
</div> |
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_item").not(":first").hide(); | |
$(".wrapper .tab").click(function() { | |
$(".wrapper .tab").removeClass("active").eq($(this).index()).addClass("active"); | |
$(".tab_item").hide().eq($(this).index()).fadeIn() | |
}).eq(0).addClass("active"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment