http://jsfiddle.net/danesoul/tSCus/2/ - Here is working example of simple JQuery UI Tabs interface.
Commented string where curent_tab is defined don't work - cause crashing tabs.
Please help me write this syntax correctly.
General idea of code: I need to have in my function MySelect()
variable which keeps index of currently selected tab
variable which keeps index of tab which is being selected when OnSelect event happens.
There is part of more complex solution, which is strongly need these two values for future compare.
Copy of jsfiddle JS code here:
function MySelect(event, ui){
var clicked_tab = ui.index //new clicked tab 0-1-2 indexes
alert(clicked_tab);
alert(curent_tab +' / '+ clicked_tab);
}
$(function() {
$('#tabs').tabs({
//var curent_tab = ui.index; //befor new one clicked 0-1-2
select: function(event, ui) {
MySelect(event, ui);
}
});
});