How can I get the tab selected Id in jQuery UI 1.9?
I use this method in jQuery UI 1.8 :
var key = $('#chart-report-tabs .ui-tabs-panel:not(.ui-tabs-hide)').prop('id');
but it does not work in the 1.9 version.
How can I get the tab selected Id in jQuery UI 1.9?
I use this method in jQuery UI 1.8 :
var key = $('#chart-report-tabs .ui-tabs-panel:not(.ui-tabs-hide)').prop('id');
but it does not work in the 1.9 version.
Try this:
$('#chart-report-tabs .ui-tabs-panel[aria-hidden="false"]').prop('id');
Try this one:
$("#<id of tabs>").tabs("option","active")
Returns zero-based index of active tab
Try this:
var $tabs = $('#chart-report-tabs');
var index = $tabs.tabs('option', 'selected');
var key = $tabs.tabs("option", "panel").find('.ui-tabs-panel').eq(index).prop('id');
Source: jQuery UI Tabs selected index
Use the activate
or beforeActivate
events with ui.newPanel
:
$('#chart-report-tabs').tabs({
activate: function(e, ui) {
var key = $(ui.newPanel).prop('id');
}
});
$('#divName .ui-tabs-panel[aria-hidden="false"]').prop('id');