How to find out if tab is enabled on jQuery tabs?

I cannot find in the jQuery user interface tab API ( http://docs.jquery.com/UI/Tabs ) a method to find out if a tab is enabled or not, I need it because in case of my application I want to enable a specific tab only if that tab is disabled.

Do you know how I can get this information from jquery api?

Thanks in advance.

+4
source share
2 answers

The disabled parameter returns the attribute of the indices of disabled tabs, so the function, to check whether there is one disabled, looks like this:

 function isDisabled(index) { return $.inArray(index, $("#tabs").tabs("option", "disabled")) > -1; } 

Here you can try here , it just uses $.inArray() to see if the index is present, just remember that the index is 0 , so the first tab is 0 , the second is 1 , etc.

+12
source

You are almost there (this is on your link): disabled

 //getter var disabled = $( ".selector" ).tabs( "option", "disabled" ); //setter $( ".selector" ).tabs( "option", "disabled", true ); 
0
source

All Articles