Reputation: 27058
I have this setup, http://jsfiddle.net/patrioticcow/LQg7W/34/.
How can the dialogs opened depending on what tabs are active?
Something is missing there..
Upvotes: 0
Views: 41
Reputation: 1905
var theSelectedTab = 0;
$( "#tabMe" ).tabs({ select: function(event, ui) {
theSelectedTab = parseFloat(ui.index);
}
});
$('#edit1').click(function() {
$('#edit_'+(theSelectedTab+1)).dialog('open');
});
});
Tested: it worked.
Upvotes: 1
Reputation: 40863
You should only need to do this?
if (theSelectedTab == 0) {
$("#edit_1").dialog("open");
} else if (theSelectedTab == 1) {
$("#edit_2").dialog("open");
}
In the if(){}
block you were assigning a live()
handler but not actually triggering anything.
Adjusted jsfiddle.
Upvotes: 1