簡體   English   中英

單擊時jQuery Nav消失

[英]Jquery Nav disappears when clicked on

在一些jquery導航標簽上工作,

問題

1)單擊選項卡時,主導航消失! 誰能看到原因???

http://jsfiddle.net/w8e8y/

/*  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();
})

是。 您隱藏了包括uls在內的所有兄弟姐妹。 而是使用屬性endswith選擇器或對內容div使用通用的classname ,將其更改為:

   $(idTab).siblings('div[id$=-tab]').stop().fadeOut(300, function () {
        setTimeout(function () {
            $(idTab).fadeIn(300);
        }, 300)
    });

$(idTab).siblings().stop().fadeOut(300, function () {
        setTimeout(function () {
            $(idTab).fadeIn(300);
        }, 300)
    })

演示版

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM