I have 3 tabs. Tab1 is selected by default. If I click Tab2; I want to get the previous selected tab.
I tried:
var previousTab;
jQuery(function () {
jQuery("#tabs").tabs({
select: function (event, ui){
doSomething(previousTab);
previousTab = jQuery(ui.tab);
},
create: function (event, ui) {
previousTab = jQuery(ui.tab);
}
});
});
This doesn’t work. Can anyone tell me the solution for this?
Thanks in Advance.
I solved it using
showfunction.previousTabis a variable in global scope.