Reputation: 865
Working on some jquery nav tabs,
The problem
1) when click on a tab the main navigation disappears ! Can anyone see why???
/* TABS
===================================================================*/
$(".profile-tabs a").click(function (e) {
e.preventDefault();
idTab = $(this).attr("href");
$(".profile-tabs .active").removeClass('active');
$(this).addClass('active');
$(idTab).siblings().stop().fadeOut(300, function () {
setTimeout(function () {
$(idTab).fadeIn(300);
}, 300)
})
// $(idTab).show().siblings().hide();
})
Upvotes: 0
Views: 61
Reputation: 123739
Yes. You are hiding all its siblings including the uls
. Instead use an attribute endswith selector or use a common classname
for the content divs, Change it to :
$(idTab).siblings('div[id$=-tab]').stop().fadeOut(300, function () {
setTimeout(function () {
$(idTab).fadeIn(300);
}, 300)
});
from
$(idTab).siblings().stop().fadeOut(300, function () {
setTimeout(function () {
$(idTab).fadeIn(300);
}, 300)
})
Upvotes: 1