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

查看:24
本文介绍了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天全站免登陆