I have 3 html box as follow:
<div class="tabs">
<ul class="tabNav">
<li><a href="#video">Video Gallery</a></li>
<li><a href="#photo">Photo Gallery</a></li>
</ul>
<div id="video"> video div </div>
<div id="photo"> photo div </div>
</div>
<div class="tabs">
<ul class="tabNav">
<li><a href="#comment">comment</a></li>
<li><a href="#links">links</a></li>
</ul>
<div id="comment"> comment div </div>
<div id="links"> links div </div>
</div>
for show and hide tabs i used this jquery code:
$(function () {
var container = $('div.tabs > div');
container.hide().filter(':first').show();
$('div.tabs ul.tabNav a').click(function () {
container.hide();
container.filter(this.hash).show();
$('div.tabs ul.tabNav a').removeClass('selected');
$(this).addClass('selected');
return false;
}).filter(':first').click();
});
This code only works with firts box (gallery) and with page load, the comment and links are also hidden. How can I solve this? Thanks in advance