Reputation: 10948
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
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
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