简体   繁体   English

使用jQuery Tabs启用标签页

[英]Enable a tab with jQuery Tabs

I disabled the tab like this: 我禁用了这样的标签:

$("#tabs").tabs({ disabled: [1, 2] });

But when I try to enable one of the tabs it is not working: 但是,当我尝试启用其中一个标签时,它不起作用:

$("#tabs").tabs({ enabled: [1] });

Is there something I'm doing wrong here? 我在这里做错什么了吗?

Never used jQuery Tabs but I can't see any option for enabled . 从未使用过jQuery Tab,但是我看不到任何enabled 选项

Have you tried to just update the list of disabled tabs to remove tab 1 ? 您是否尝试仅更新禁用的选项卡列表以删除选项卡1?

$("#tabs").tabs({ disabled: [2] });

or 要么

$("#tabs").tabs( "enable" , 1 ); 

(that's in the docs ) 在docs中

Try $("selector").tabs("enable", n); 尝试$("selector").tabs("enable", n); where n is the index of the tab 其中n是标签的索引

I believe you are looking for the .tabs( "option" , optionName , [value] ) method found on this page: http://jqueryui.com/demos/tabs/ (click the "Method" tab and find "option" below). 我相信您正在寻找在此页面上找到的.tabs( "option" , optionName , [value] )方法: http : //jqueryui.com/demos/tabs/ (单击“ Method”选项卡并找到“ option”下面)。

$("#tabs").tabs( "option" , "disabled" , [2] );

Update 更新资料

Under the section of the docs for $(selector).tabs('enable', n) there is this statement: $(selector).tabs('enable', n)的文档部分下$(selector).tabs('enable', n)有以下语句:

To enable more than one tab at once reset the disabled property like: $('#example').tabs("option","disabled",[]); 要一次启用多个标签,请重置禁用的属性,例如: $('#example').tabs("option","disabled",[]); .

不应该是$("#tabs").tabs("enable", [1])吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM