負載

2011-12-01 50 views
1

禁用jQuery UI的標籤我現在有這樣的代碼:負載

$(".feature-tabs").tabs( 
{ collapsible: true, fx: [{opacity:'toggle', duration:'slow', height: 'toggle'}, // hide option 
{opacity:'toggle', duration:'slow', height: 'toggle'}]}); // show option 

,我想設置的選項卡頁面加載時,但我有麻煩,它被禁用。我已經嘗試添加禁用:真正的選項,但不能得到它的工作。

難道有人請告訴我正確的方法嗎?感謝您的幫助

編輯:標籤的HTML:

<div class="feature-tabs" id="tabs-set"> 
    <ul> 
     <li><a href="#tabs-1" id="tab1">How does it<br/>work?</a></li> 
     <li><a href="#tabs-2" id="tab2">Heating Start<br/>Time</a></li> 
     <li><a href="#tabs-3" id="tab3">Turning on<br/>the boiler</a></li> 
    </ul> 
    <div id="tabs-1"> 
     <p>test</p> 
     </div> 
    <div id="tabs-2"> 
     <p>test2</p>   
       </div> 
    <div id="tabs-3"> 
     <p>test3</p> 
     </div> 
</div> 
+0

可以發表這個標籤的html代碼 –

回答

3

您應該使用

disabled: [1, 2] 

其中陣列的數量將被禁止(從0開始),這樣的標籤該禁用第二個和第三個選項卡

編輯你的情況使用

$(".feature-tabs").tabs({ 
    disabled: [0, 1, 2], 
    collapsible: true, 
    fx: [{ 
     opacity: 'toggle', 
     duration: 'slow', 
     height: 'toggle'}, // hide option 
     {opacity: 'toggle', 
     duration: 'slow', 
     height: 'toggle'}] 
}); // show option 

小提琴這裏http://jsfiddle.net/WqPtr/

+0

謝謝,完美的作品! –

0

您需要設置殘疾人值爲每個選項卡的索引來禁用一個數組給出每個選項卡 - 中標籤是零索引。

有關更多詳細信息,請閱讀http://jqueryui.com/demos/tabs的選項選項卡。