Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set a default tab with Jquery UI

I'm using Jquery and Jquery UI with the following:

$(document).ready(function() {
    $('#tabvanilla > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle' } });
});

Right now it automatically sets the first tabs as the default tab that is selected when the document loads. How do I override this and make the second tab the default selected tab when the page loads?

like image 423
Lee McAlilly Avatar asked Sep 04 '09 03:09

Lee McAlilly


People also ask

How do I change the default tab on a page load?

Select the Settings button. Choose General Setup & Options. Click on System Settings to expand the section. Locate the setting Default Tab on Page Load (Consumer Mode).

How to disable jQuery tab?

disable( index )Returns: jQuery (plugin only) Disables a tab. The selected tab cannot be disabled. To disable more than one tab at once, set the disabled option: $( "#tabs" ). tabs( "option", "disabled", [ 1, 2, 3 ] ) .

How do I know which tab is selected in jquery?

var selectedTab = $("#TabList"). tabs(). data("selected. tabs");


1 Answers

$('#tabvanilla > ul').tabs({ selected: 1 });

More details on the specifications page.

like image 113
Mark Hurd Avatar answered Oct 04 '22 08:10

Mark Hurd