I have big web application using JQuery UI Tabs. In central JS file I have setted all tabs.
Using
$("#tabs").tabs;
But on one page I need to have selected another tab than first.
If I use
$("#tabs").{ selected: add });
(name of tab is #add)
Its not running, probably because Tabs are already set up.
Does anyone know how to set opened another than first tab (in default state - after loading page) if tabs are already turned on?
I hope, you will understand, my English is pretty terrible.
I know this one's old, but I noticed an error in the code you have written:
$("#tabs").{ selected: add });
This should be
$("#tabs").tabs({ selected: add });
Also, selected
option is deprecated as of jquery ui 1.9 as indicated here. Recommended is the active
option, details here
In any case, use the index of the tab you want to open, not the href
value; i.e. if you want to open the 3rd tab use
$("#tabs").tabs({ selected: 2 });
or
$("#tabs").tabs({ active: 2 });
check this fiddle
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