jQuery UI选项卡-“正在加载..."信息 [英] JQuery UI Tabs - "Loading..." message

查看:89
本文介绍了jQuery UI选项卡-“正在加载..."信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部

我正在使用Jquery UI嵌套选项卡.我只是想知道在加载选项卡时,是否有任何方法可以在选项卡文本旁边显示AJAX Spinner图像.我不想将标签文本更改为正在加载..".考虑到当多个选项卡同时或一个接一个地加载时,微调器图像应显示在每个加载选项卡旁边.

I am using Jquery UI nested tabs. I was just wondering if there is any way to display an AJAX Spinner image next to the tab text, while the tab is loading. I do not want to change the tab text to "Loading..". Consider that when multiple tabs are loading at the same time or one after the other, the spinner image should be displayed next to each loading tab..

有什么建议吗?

谢谢

推荐答案

如果对选项卡使用缓存,则此解决方案可能更合适,它仅在内容尚未显示时显示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>")
     }
    }
 })

这篇关于jQuery UI选项卡-“正在加载..."信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆