Hi,
how can i activate the second tab of my web page in page load , i have done the tabs using jquery and ul.
below is the codes
<div class="tabcontainer">
<ul class="tabs">
<li><a href="#tab1">Saved Recipes</a></li>
<li><a href="#tab2">Groups</a></li>
<li><a href="#tab3">Friends</a></li>
<li><a href="#tab4">My Recipes</a></li>
</ul>
</div>
<div class="tab_container">
<!-- Tab 1 Starts Here -->
<div id="tab1" class="tab_content"></div>
<div id="tab2" class="tab_content"></div>
<div id="tab3" class="tab_content"></div>
<div id="tab4" class="tab_content"></div>
</div>
Script:
$(document).ready(function() {
//Default Action
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").addClass("active").show(); //Activate first tab
$(".tab_content:first").show(); //Show first tab content
//On Click Event
$("ul.tabs li").click(function() {
$("ul.tabs 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 rel attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active content
return false;
});
});
I know how to activate first and last one, but how can i activate the second and third one during page load.
please help...