Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery tabs enable tab?

Tags:

jquery

ajax

tabs

I am trying to enable a disabled tab in Jquery but it doesn't work. I have my tabs:

<!--Jquery AJAX Tabs Start-->
<div id="signuptabs">
     <ul>
         <li><a href="type.php"><span>type</span></a></li>
         <li><a href="ber.php"><span>mber</span></a></li>
         <li><a href="ces.php"><span>ces</span></a></li>
         <li><a href="ups.php"><span>ups</span></a></li>
    <li><a href="t.php"><span>ext</span></a></li>
        <li><a href="nu.php"><span>u</span></a></li>
        <li><a href="nfo.php"><span>ion</span></a></li>
     </ul>

</div>
<!--Jquery AJAX Tabs End-->

Then I have my Javascript:

  $(document).ready(function() {
    $("#signuptabs").tabs({ disabled: [1, 2, 3, 4, 5, 6, 7] });

//number type button
$('#target').click(function() {
$('#signuptabs').enableTab(2); // enables third tab
 });

 }); 

I have a button with an ID 'target' that when clicked is supposed to enable the (2) tab. The tabs show as disabled but will not enable. What is wrong??

like image 793
user342391 Avatar asked Dec 12 '22 21:12

user342391


2 Answers

The call to the enable method is a alightly different syntax than you currently have, like this:

$('#signuptabs').tabs('enable', 2)
like image 53
Nick Craver Avatar answered Dec 29 '22 14:12

Nick Craver


this also works to enable a tab 2 and disable tab 1 and 3

$("#signuptabs").tabs('select',1);
    $("#signuptabs").tabs({disabled: [0,2]});
like image 39
Akhilraj ns Avatar answered Dec 29 '22 14:12

Akhilraj ns