Skip to content

Instantly share code, notes, and snippets.

@stephanielingwood
Created July 24, 2014 07:24
Show Gist options
  • Save stephanielingwood/c51d6c84e47882c3e668 to your computer and use it in GitHub Desktop.
Save stephanielingwood/c51d6c84e47882c3e668 to your computer and use it in GitHub Desktop.
jQuery for Tabs
$(document).ready(function() {
$('#show-tab').addClass('active-tab');
$('#show-content').addClass('active-content');
$('.tabs').on('click', function() {
var selected = $(this).attr('.tabs > class');
$('.tab-text').fadeOut('slow');
$('.tab-content').removeClass('active-content');
$('.tabs').removeClass('active-tab');
$('this').addClass('active-tab');
$('.tab-content' + '.' + selected).fadeIn('slow');
console.log(selected);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment