jQuery UI Tabs run function when tabs is clicked
I'm using jQuery UI tabs wi开发者_如何学Pythondget. How do we run a function when a tab is clicked on. I can't find any built in event that handles this.
From the docs:
tabsselect
This event is triggered when clicking a tab.
// Supply a callback function to handle the select event as an init option.
$( ".selector" ).tabs({
select: function(event, ui) { ... }
});
// Bind to the select event by type: tabsselect.
$( ".selector" ).bind( "tabsselect", function(event, ui) {
...
});
Note: if you want to run a function after the tab has loaded (especially if it's a remote tab), you probably want the load
/tabsload
event instead.
Here is the documentation from jquery UI
$( ".selector" ).bind( "tabsselect", function(event, ui) {
...
});
Link
精彩评论