简体   繁体   English

根据用户选择禁用和启用jquery选项卡

[英]Disable and enable jquery tabs based on user selection

I am using jquery tabs to present some data , I want to give user an option to choose if she/he wants it to be displayed as tabs or in one after another. 我正在使用jquery选项卡来显示一些数据,我想给用户一个选择,以便选择是否将其显示为选项卡或一个接一个地显示。 When the user selects from a drop down how she/he wants to view I remove/add the ui-tabs classes but this approach doesnot seem to work. 当用户从下拉列表中选择要查看的方式时,我删除/添加了ui-tabs类,但是这种方法似乎行不通。 There is also one workaround to destroy and create it on every call but I suppose this is not a good approach. 还有一个解决方法,可以在每次调用时销毁并创建它,但是我认为这不是一个好方法。 Can any one suggest me what to do ... 谁能建议我该怎么办...

Have you tried 你有没有尝试过

$('#tabsDiv').tabs('disable', 1); //where 1 is the tab number

or apply a class on specific tab 或在特定标签上应用课程

.ui-tabs-disabled {
    display: none; 
} 

Refer this link for more info 请参阅链接以获取更多信息

你可以这样做

$( "#tabs" ).tabs( "destroy" );

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

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