user969068
user969068

Reputation: 2943

Hide all tabs content jQuery UI tabs onload

Is it possible to load just tabs when page is loaded?

Sample code:

http://jsfiddle.net/MWtMR/2/

It should only display text if I click on some tab. Divs #tab1, #tab2, #tab3 should remain hidden until I click on one of the tabs.

Update: http://jsfiddle.net/MWtMR/3/

I found it by setting collapsible: it is true that I can click and it will close that tab content. How can I make this behavior on load of the page?

Upvotes: 0

Views: 3997

Answers (2)

Edy Hinzen
Edy Hinzen

Reputation: 11

Update

Since jQuery UI 1.10, you'll have to use parameter active instead of selected.

$('#tabvanilla').tabs({ active: false, collapsible: true });

See http://api.jqueryui.com/tabs/#option-active for details.

Upvotes: 1

Alex Peattie
Alex Peattie

Reputation: 27637

Set the selected option to -1

$('#tabvanilla').tabs({ fx: { height: 'toggle', opacity: 'toggle'}, selected: -1 });

Updated fiddle: http://jsfiddle.net/MWtMR/4/

Upvotes: 2

Related Questions