How do I perform an action when a tab is shown?
I’ve tried the example from http://jqueryui.com/demos/tabs/#event-show but don’t seem to see what I’m doing wrong.
$( "#General_Files" ).bind( "tabsshow", function(event, ui) {
console.log('Performing action here');
});
Where General_Files is the ID of the tab.
I’m using jquery-ui-1.8.21 and jquery-1.7.2.
Thanks h0tw1r3
Solution:
Here’s how I got it to work.
<div id="tabwidget">
<ul><li><a href="#General_Files">General Files</a></li></ul>
<div id="General_Files">content</div>
</div>
The following worked.
$( "#tabwidget" ).bind( "tabsshow", function(event, ui) {
console.log('Performing action here');
});
Change to the ID of the tab widget and use
ui.panelto access the actual tab in the function.