Last active
April 4, 2020 08:42
-
-
Save prosantamazumder/03fd1239368a24571179adef370f9ce6 to your computer and use it in GitHub Desktop.
jQuery Custom nav Tabs
This file contains hidden or 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
// Show the first tab and hide the rest tabs | |
$('#tabs-nav :first-child').addClass('active'); | |
$('.tab-content').hide(); | |
$('.tab-content:first').show(); | |
// Click function | |
$('#tabs-nav ').click(function(){ | |
$('#tabs-nav ').removeClass('active'); | |
$(this).addClass('active'); | |
$('.tab-content').hide(); | |
var activeTab = $(this).find('a').attr('href'); | |
$(activeTab).fadeIn(); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment