Created
July 24, 2014 07:24
-
-
Save stephanielingwood/c51d6c84e47882c3e668 to your computer and use it in GitHub Desktop.
jQuery for Tabs
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
$(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