I have a monthly calendar with just basic HTML tables, with each month in a jQuery UI tabs tab. How can I change which jQuery UI tab is loaded by default? I want to keep the months in order in the navigation, but have the current month show on page load.
Set the active property in the object you pass to the tabs function to the index of the tab you want to make default. Index starts at 0. So to make the third tab the default: $("#tabs").
Tabs are the set of logically grouped content that facilitates users to flip between them. Tabs save the space like accordions. Every tab must use the following set of markups to work properly. Tabs must be in an ordered <ol> or unordered <ul> list.
Please note that this option got renamed in jqueryui 1.9, it is now called "active" (hope this saves someone else the headache I just went through):
$('#tabid').tabs({ active: index });
or
$('#tabid').tabs("option", "active", index);
See: http://api.jqueryui.com/tabs/#option-active
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With