1

I am implementing jquery tabs in my project. I am new to jquery. How can i get the tab change event to make a new ajax call? Also I want to implement sub-tabs in some tabs. The sub-tabs should only be visible when the respective parent tab is selected.

Please give a suitable solution. Any effort would be appreciated.

Shikhar
  • 43
  • 1
  • 8

1 Answers1

1

You may get the select or activate event for tabs, as:

$('#tabs').tabs({
    select: function(event, ui){
        // Do stuff here
    }
});

For sub-tabs, you may attach events at run-time. If the sub-tabs are static, you may use the approach mentioned above with sub-tabs too.

Check this SO question on trapping tab select event.

Community
  • 1
  • 1
Vivek Jain
  • 3,811
  • 6
  • 30
  • 47