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

前端 未结 14 2113
刺人心
刺人心 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:43

    None of these answers worked for me. I just by-passed the problem. I did this:

    $('#tabs-tab1').removeClass('tabs-hide');
    $('#tabs-tab2').addClass('tabs-hide');
    $('#container-tabs a[href="#tabs-tab2"]').parent().removeClass('tabs-selected');
    $('#container-tabs a[href="#tabs-tab1"]').parent().addClass('tabs-selected');
    

    It works great.

提交回复
热议问题