Last active
August 29, 2015 14:20
-
-
Save connorshea/5581d4cd60795ba9e584 to your computer and use it in GitHub Desktop.
Tabs example code
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
function tabbedMenu() { | |
$('ul#user-page-header-tabs li').click(function() { | |
var tabid = $(this).attr('data-tab'); | |
$('ul#user-page-header-tabs li').removeClass('current'); | |
$('.tab-content').removeClass('current'); | |
$(this).addClass('current'); | |
$('.tc-' + tabid).addClass('current'); | |
}); | |
} | |
var ready = function() { | |
tabbedMenu(); | |
}; | |
$(document).ready(ready); |
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
<ul id="user-page-header-tabs"> | |
<li data-tab="tab-1" class="user-page-header-tab current"><%= t(".uploads") %> | |
<li data-tab="tab-2" class="user-page-header-tab"><%= t(".creations") %> | |
<li data-tab="tab-3" class="user-page-header-tab"><%= t(".collections") %> | |
</ul> | |
<div id="user-uploads-container" class="tab-content tc-tab-1 current"> | |
<!-- Content goes here --> | |
</div> | |
<div id="user-creations-container" class="tab-content tc-tab-2"> | |
<!-- Content goes here --> | |
</div> | |
<div id="user-collections-container" class="tab-content tc-tab-3"> | |
<!-- Content goes here --> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment