143

Can you disable tabs in Bootstrap 2.0 like you can disable buttons?

jemiloii
  • 24,594
  • 7
  • 54
  • 83
arbme
  • 4,831
  • 11
  • 44
  • 57

17 Answers17

199

You could remove the data-toggle="tab" attribute from the tab as it's hooked up using live/delegate events

Mosh Feu
  • 28,354
  • 16
  • 88
  • 135
Betty
  • 9,109
  • 2
  • 34
  • 48
  • 9
    Or add a disabled class to the li – Pencilcheck Aug 14 '13 at 00:56
  • 2
    + Adding a `disabled` css-class to the `li` – Jaider Jun 10 '14 at 19:55
  • 6
    You need to use both suggestions above: Add "disabled" class to
  • AND Remove data-toogle or href attribute from tab
  • – Scabbia Nov 06 '14 at 17:37
  • 9
    I simply added this CSS and now `class="disabled"` works as expected `.nav.nav-tabs > li.disabled { pointer-events: none; a { color: silver; } }` – effe Jun 19 '15 at 22:10
  • The border of the currently active tab gets still removed with this solution, when I click on a disabled tab. – robsch Nov 04 '16 at 13:12
  • @effe super answer. Best solutions. It disables the click and allows us to navigate through next previous buttons. Where as the above solutions disables all the options to navigate. – Augus Apr 27 '20 at 07:23