[英]Jquery UI tabs disabled on load
我目前有這個代碼:
$( ".feature-tabs" ).tabs(
{ collapsible: true, fx: [{opacity:'toggle', duration:'slow', height: 'toggle'}, // hide option
{opacity:'toggle', duration:'slow', height: 'toggle'}]}); // show option
並且我想將頁面加載時將選項卡設置為禁用,但是我遇到了麻煩。 我嘗試在選項中添加disabled:true但無法使其工作。
有人可以告訴我正確的方法嗎? 謝謝你的幫助
編輯:標簽的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>
你應該用
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
看看您是否嘗試禁用JQuery UI站點上給出的每個選項卡
$( ".selector" ).tabs({ disabled: [1, 2] });
您需要將禁用值設置為一個數組,其中每個選項卡的索引均要禁用-選項卡為零索引。
有關更多詳細信息,請參閱http://jqueryui.com/demos/tabs的“選項”標簽中的“禁用”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.