BrilliantBrains BrilliantBrains - 1 year ago 197
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>

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

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


Answer Source

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]);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download