且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery UI选项卡-“正在加载..."信息

更新时间:2023-12-05 17:33:34

如果对选项卡使用缓存,则此解决方案可能更合适,它仅在内容尚未显示时显示ajax加载.这页纸.

If you're using caching for your tabs, then this solution is propably a better fit, it only shows the ajax loading if the content isn't already on the page.

$(".tabs").tabs({
   cache:true,
   load: function (e, ui) {
     $(ui.panel).find(".tab-loading").remove();
   },
   select: function (e, ui) {
     var $panel = $(ui.panel);

     if ($panel.is(":empty")) {
         $panel.append("<div class='tab-loading'>Loading...</div>")
     }
    }
 })