jQuery UI tabs. How to select a tab based on its id not based on index

前端 未结 14 2213
刺人心
刺人心 2020-12-25 11:07

I have two tabs and configured usign jQuery UI.

ul  class=\"tabs\"
  li  tabone
  li tabtwo
ul

dynamically from C# code behind I will hide

14条回答
  •  太阳男子
    2020-12-25 11:48

    I make a wild assumption that you really have layout as:

    • one
    • two

    IF that assumption is correct, you simply use the ID to select the "tab"

    $('#tabone').css("display","none");
    

    EDIT: select the tab on your layout:

    var index = $('.tabs ul').index($('#tabone')); 
    $('.tabs ul').tabs('select', index); 
    

提交回复
热议问题