My site has a tabbed interface that is used sequentially on all pages. I can link to the base page (first tab), but I can’t figure out how to link it to a specific tab.
This is my JavaScript:
$(document).ready(function() {
$(".tabs a").click(function() {
var $this = $(this);
$(".panel").hide();
$(".tabs a.active").removeClass("active");
$this.addClass("active").blur();
var panel = $this.attr("href");
$(panel).fadeIn(250);
return false;
});
$(".tabs li:first-of-type a").click();
});
And each of my pages is configured as follows:
<div id="aboutContainer">
<ul class="tabs">
<li><a href="#panel1">About Us</a></li>
<li><a href="#panel2">Contact Us</a></li>
<li><a href="#panel3">Mailing List</a></li>
<li><a href="#panel4">Terms</a></li>
<li><a href="#panel5">Privacy Policy</a></li>
<li><a href="#panel6">Help</a></li>
</ul>
<div class="panelContainer">
<div class="panel" id="panel1">
<?php include('includes/aboutme.php'); ?>
</div>
<div class="panel" id="panel2">
<?php include('includes/contact.php'); ?>
</div>
<div class="panel" id="panel3">
<?php include('includes/mailinglist.php'); ?>
</div>
<div class="panel" id="panel4">
<?php include('includes/terms.php'); ?>
</div>
<div class="panel" id="panel5">
<?php include('includes/privacypolicy.php'); ?>
</div>
<div class="panel" id="panel6">
<?php include('includes/cheekyreference.php'); ?>
</div>
</div>
</div>
Any pointers would be greatly appreciated. I am new to JavaScript and could not find the answer on the Internet.
To clarify the situation a bit:
about.php, . , , : , , . , , " " "", , .