Jquery tabs anchor tabsselect or tabsshow not starting

I have a problem with jquery tabs. If I bind to tabsselect or tabsshow tab events, they do not fire.

I am using the latest jquery-ui 1.10.3 and there are no js errors in my webapp console.

the code:

$("#tabs").tabs(); $("#tabs").bind('tabsselect', function(event, ui) { alert(ui.index); // This is never displayed if (ui.index === 1 && plot1._drawCount === 0) { plot1.replot(); } else if (ui.index === 2 && plot2._drawCount === 0) { plot2.replot(); } }); 
+4
source share
1 answer

Activate event

 $("#tabs").on('tabsactivate', function(event, ui) { var index = ui.newTab.index(); alert(index); // This is never displayed if (ui.index === 1 && plot1._drawCount === 0) { plot1.replot(); } else if (ui.index === 2 && plot2._drawCount === 0) { plot2.replot(); } }); 

Demo: Fiddle

+10
source

Source: https://habr.com/ru/post/1501899/


All Articles