JQuery UI + tabs : How to kow to get the selected tab with imbricated tabs

为君一笑 提交于 2019-12-08 06:45:55

问题


I'm new to Jquery.
I'm using JQuery UI and i have imbricated Tabs : Tabs in tabs.

___________
tab 1 | tab 2 | tab 3 | tab 4| tab 5
_____________
tab 1-1 | tab 1-2 | tab 1-3 | tab 1-4| tab 1-5

I'm using $('#div').bind('tabsselect', function(event, ui) {

selectedTab = ui.index;
alert('selectedTab : ' + selectedTab);
});

to kown the selected index.
If i click on "tab "1 the selected index returned is correct.

But when click on tabs in the second level ("tab 1-xx") the event is fired too. I want to resctriced the bind('tabsselect', function(event, ui) on the first level of tab (tab x).

How can i do that ?

Thanks


回答1:


Could you post the code of the tabs?

I supose the problem is because inside the "#div" you have defined the children. So jquery trigger the event of tag select of tab 1-x to its parent

maybe you could try to unbind the event for each of the children.



来源:https://stackoverflow.com/questions/2355192/jquery-ui-tabs-how-to-kow-to-get-the-selected-tab-with-imbricated-tabs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!