Nested jQuery tabs

前端 未结 3 1614
耶瑟儿~
耶瑟儿~ 2021-01-21 17:29

I\'m new to jQuery (a couple of weeks). I\'m trying to nest the jQueryUI tab control. It works fine until the nested tabs are in an external file then I get an exception thrown

3条回答
  •  日久生厌
    2021-01-21 17:47

    You are definitely running into a little bit of trouble with your duplicated 'Tabs' ID attribute. The following example should achieve what you're looking for:
    Main File (Outer Tab)

    
    
        
        
        
        
        
        
    
    
    
      
          
    
      
    

    Tab 1 (tab1.html)

    This is tab b1 content
    This is tab b2 content

    Tab 2 (tab2.html)

    This is tab A1 content
    This is tab A2 content

    This way, when you run your main file, the two tab files are requested via jQuery and loaded into the appropriate divs. Then I have defined a callback to activate the tabs that were just loaded.

    If you need more details just follow up with a comment.

提交回复
热议问题