Created
February 19, 2015 15:23
-
-
Save zurie/7c81748527164b7b5ca7 to your computer and use it in GitHub Desktop.
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
$(document).ready(function() { | |
//When page loads... | |
$(".tab_content").hide(); //Hide all content | |
$("ul.tabbed-content li:first").addClass("active").show(); //Activate first tab | |
$(".tab_content:first").show(); //Show first tab content | |
//On Click Event | |
$("ul.tabbed-content li").click(function() { | |
$("ul.tabbed-content li").removeClass("active"); //Remove any "active" class | |
$(this).addClass("active"); //Add "active" class to selected tab | |
$(".tab_content").hide(); //Hide all tab content | |
var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content | |
$(activeTab).fadeIn(); //Fade in the active ID content | |
return false; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment