簡體   English   中英

Bootstrap選項卡 - 下一個和上一個按鈕

[英]Bootstrap Tabs - Next and Previous Buttons

我有以下內容: http//goo.gl/FZMd33

我想要的輸出是如果選擇第一個選項卡,前一個按鈕被禁用,另一端選擇最后一個選項卡時,下一個選項卡將被禁用。

另外作為一個單獨的想法,我也希望實現Next按鈕顯示第一個選項卡,如果當前選中了最后一個選項卡,則與第一個選項卡上的Previous按鈕相反,以顯示最后一個選項卡

試試下面的代碼

//Put this code on click of **Next Button**

        if ($tabs.filter('.active').next('li').length > 0) {
             $('#wheel-right').removeAttr("disabled");
         } else {
             $('#wheel-right').attr("disabled", "disabled");
         }




// Put this code on click  of **Previous Button**

     if ($tabs.filter('.active').prev('li').length > 0) {
         $('#wheel-left').removeAttr("disabled");
     } else {
         $('#wheel-left').attr("disabled", "disabled");
     }

暫無
暫無

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

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