简体   繁体   English

JQuery-UI / JQuery选项卡不刷新

[英]JQuery-UI/JQuery tabs not refreshing

I have recently upgraded from jquery 1.4 to Jquery 1.10.1 and jquery-UI to version 1.10.3 and now my refresh tabs functionality is not working. 我最近从jquery 1.4升级到了jquery 1.10.1,并将jquery-UI升级到了1.10.3版,现在我的刷新选项卡功能不起作用。

Here is what I had 这就是我所拥有的

$('#tabs').tabs('load', $('#tabs').tabs('option', 'selected'));

I have looked online for specific ways to achieve this using the versions I have with no luck and other exampes like using declaring the index dont seem t work. 我一直在网上寻找使用我没有运气的版本来实现此目标的特定方法,以及使用诸如声明索引似乎不起作用的其他示例。

I have stuck an alert on $("#tabs").tabs("option", "selected"); 我在$("#tabs").tabs("option", "selected");上添加了警报 to what value it is getting and this is always null which indicated the problem is with this statement 得出的值是多少,并且始终为null ,这表明此语句存在问题

Ho do you refresh jquery tabs in the versions I am using? 您如何在我使用的版本中刷新jquery选项卡?

Try using the tab's .refresh() method which was added in 1.9 . 尝试使用1.9添加的选项卡的.refresh()方法。

refresh() 刷新()

Process any tabs that were added or removed directly in the DOM and recompute the height of the tab panels. 处理直接在DOM中添加或删除的所有选项卡,然后重新计算选项卡面板的高度。

Ex: 例如:

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

The second answer to this question helped me fix the issue: 这个问题的第二个答案帮助我解决了这个问题:

jQuery UI Tabs Get Currently Selected Tab Index jQuery UI选项卡获取当前选定的选项卡索引

In JQuery 1.9 the selected key word was changed to 'active' 在JQuery 1.9中,所选关键字已更改为“活动”

$('#tabs').tabs('load', $('#tabs').tabs('option', 'active'));

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

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