Skip to content

Instantly share code, notes, and snippets.

@al-the-x
Created May 27, 2015 14:05
Show Gist options
  • Save al-the-x/bd29a829ecfb13d6b8f9 to your computer and use it in GitHub Desktop.
Save al-the-x/bd29a829ecfb13d6b8f9 to your computer and use it in GitHub Desktop.
$(function() { // on document ready
$('#tabs li').on('click', function(event) {
// Every <a> on the page?
// $('a').parent().removeClass('tab-current');
$(this).siblings().removeClass('tab-current');
$(this).addClass('tab-current');
// Every <section> on the page?
// $('section').removeClass('content-current');
var panelId = $(this).children('a').attr('href');
var $panel = $(panelId);
$mySection.addClass('content-current')
.siblings().removeClass('content-current');
});
}); // END document ready
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment