Blaze Tama
Blaze Tama

Reputation: 10948

Set default focus tab in jQuery UI tabs

I use #tabs ul li a:focus in CSS and its working perfectly. Now, i want the first tab will be automatically focused everytime my web is opened (so the user dont need to click it first).

I have tried selected and active. Both of them is working, but its not focused.

code example :

$( "#tabs" ).tabs({ active: 0 });

The code above will activate the first tab, but its not focused yet.

Thanks for your help :D

Upvotes: 1

Views: 6265

Answers (2)

tavor999
tavor999

Reputation: 477

According to the jquery tabs doucmentation it is as follows:

$('#tabs').tabs({active: 1});

Notices it is using a colon and not a comma.

Upvotes: 0

Rohan Kumar
Rohan Kumar

Reputation: 40639

Try this:

$('#tabs').tabs("option", "active", 1);

or

$('#tabs').tabs({active, 1});

Read this Set default tab in jQuery UI Tabs

Upvotes: 1

Related Questions