BrilliantBrains BrilliantBrains - 3 months ago 22
jQuery Question

Jquery UI Tabs Disable

I am using jquery UI tabs, i want to disable the tabs. for that i have already setup my tab as describes below for the HTML and the Jquery. The tab control works fine but it doesn't disable the tabs.

<div class="tabs-container h-tabs">
<ul class="tabs">
<li><a href="#">tab 1</a></li>
<li><a href="#">tab 2</a></li>
<li><a href="#">tab 3</a></li>
</ul>

<div class="tab-content">
<div>Tab 1</div>
<div>Tab 2</div>
<div>Tab 3</div>
</div>
</div>
<script type="text/javascript">
(function () {
$(".tabs-container ul.tabs").tabs("div.tab-content > div", { tabs: 'a', effect: 'fade', fadeOutSpeed: -200, history: false, initialIndex: 1 });


// DISABLE THE TABS
$(".tabs-container ul.tabs").tabs("option","disable", [1,2,3]); // IT DOESN'T WORK!!!

})();
</script>

Answer

Got it. Try below code. It should be "disabled" instead of "disable", and the indexes are zero-based:

$(".tabs-container ul.tabs").tabs("option","disabled", [0, 1,2]);
Comments