How to set a default tab with Jquery UI

后端 未结 3 1346
时光取名叫无心
时光取名叫无心 2021-02-13 17:42

I\'m using Jquery and Jquery UI with the following:

$(document).ready(function() {
    $(\'#tabvanilla > ul\').tabs({ fx: { height: \'toggle\', opacity: \'tog         


        
相关标签:
3条回答
  • 2021-02-13 18:18

    If you happen to be using jQuery UI >= 1.9, this is how it works:

    $(".selector" ).tabs({ active: 2 });
    

    More details on the Tabs Widget API page: http://api.jqueryui.com/tabs/#option-active

    0 讨论(0)
  • 2021-02-13 18:33

    I found this alternate solution which might be preferable in some situations: http://www.markhneedham.com/blog/2010/09/08/jquery-ui-tabs-changing-selected-tab/

    0 讨论(0)
  • 2021-02-13 18:41
    $('#tabvanilla > ul').tabs({ selected: 1 });
    

    More details on the specifications page.

    0 讨论(0)
提交回复
热议问题