Twitter Bootstrap tabs not working: when I click on them nothing happens

前端 未结 13 1074
温柔的废话
温柔的废话 2020-12-04 10:49

I am trying to implement Twitter Bootstrap tabs in the following code, but it does not seem to work. The tabs get displayed, but when I click on them nothing happens. Below

13条回答
  •  -上瘾入骨i
    2020-12-04 11:35

    You need to add tabs plugin to your code

    
    

    Well, it didn't work. I made some tests and it started working when:

    1. moved (updated to 1.7) jQuery script to section
    2. added data-toggle="tab" to links and id for
        tab element
      • changed $(".tabs").tabs(); to $("#tabs").tab();
      • and some other things that shouldn't matter

    Here's a code

    
    
    
    
    
    
    
    
    
    
    

    Red

    red red red red red red

    Orange

    orange orange orange orange orange

    Yellow

    yellow yellow yellow yellow yellow

    Green

    green green green green green

    Blue

    blue blue blue blue blue

提交回复
热议问题