Tabs can be loaded specifically when landing on a page, that’s part of the tabs functionality, but will not work with the “Set active tab” option enabled. In addition to that, selecting the active tab only works for the first time you land on the page and applicable anchor(it won’t switch tab using the anchors for any additional anchor references – that’s specific to the tabs script, not the plugin).
You could, as you’ve suggested, switch tabs using jQuery and calling the active tab setter.
jQuery(document).ready(function($){
$('#selector-for-your-button').click(function(){
$('#tabs-n').tabs( 'option', 'active', 0 ); // Selects the first tab
});
});
Where n
in the tabs selector refers to the tabs instance, in your above example the n
refers to 1
.
The 0
in the tabs third argument refers to the key of the tab to select, the index starts at zero, first tab is 0
, second is 1
and so on.
Hope that helps. ??