How to disable tabs using jquery

I have three sub-tables in the main tab, when I click on the main tab, I’m demeaning, I dislike tab1 data using the jquery grid, now I initially need to disable tab2 and tab3,

can someone help me thanks

+7
jquery
source share
3 answers

The jQuery UI tab has documentation . Please note that it is based on the zero level, therefore it disables the 2nd and 3rd tabs.

$( ".selector" ).tabs( { disabled: [1, 2] } ); 
+17
source share

Assuming you are using jQuery user interface tabs:

You can use "disable" to disable this tab after initialization:

 jQuery("#myTab").tabs( "disable" , index ) 

Alternatively, if you need to disable tabs when you first display tabs, you can pass the disabled parameter and an array of tabs to disable:

 $( ".selector" ).tabs( { disabled: [1, 2] } ); 
+9
source share

This means that you do not want the user to click on other tabs. You can do the same using the following method:

 $("#tabs ul li a").attr("disabled", "disabled"); 
-2
source share

All Articles