0

我正在使用 jQuery 选项卡,每个选项卡都有不同的高度。当我选择一个选项卡时,我需要刷新 div 中的内容以适应出现/消失的窗口滚动。

查看选项卡插件的 API 文档有加载事件和选择事件。我似乎找不到任何其他可以插入的事件。

负载事件工作正常,但在选择已加载的选项卡时,在显示内容之前已加载的选项卡。

$("#tabs").tabs({
    cache: false,
    select: function (e, ui) {
        // running the event here will not work as it runs before the content is diplayed
    },
    load: function (event, ui){
        // running it here works ok as it fires the event after the content is displayed
    }
});

我需要在显示内容后触发事件。

有没有我可以针对这种特定行为插入的事件?

4

1 回答 1

1

JqueryUI 1.8 API 文档描述了showselect事件。

如果show不起作用,那么也许在select处理程序中配置一个计时器以在几毫秒后刷新 div 就可以了。

于 2013-03-08T22:32:13.357 回答