I have this jQuery Tab Code:
$(function() {
$('#tabs div').hide(); // Hide divs
$('#tabs div:first').show(); // Show first div
$("li").click(function(e) {
e.preventDefault();
$("li").removeClass("selected");
$(this).addClass("selected");
var currentTab = $(this.children).attr('href'); // Set currentTab to value of href attribute
$('#tabs div').hide(); // Hide all divs
$(currentTab).show(); // Show div with id equal to variable currentTab
return false;
});
});
The thing is, that each time I click on an anchor links it "toggles" a tab:
<div id="tabs">
<ul class="tabrow">
<li class="selected"><a href="#tab-one">Contest</a></li>
<li><a href="#tab-two">Prizes</a></li>
</ul>
<div id="tab-one" class="center">
</div>
<div id="tab-two" class="center">
</div>
</div>
How can I do so only the links in the UL will be affected by this jQuery code?