jqtouch - 没有出现加载图像

发布于 2024-09-12 13:17:37 字数 164 浏览 1 评论 0原文

我正在使用 jqtouch 创建一个 Web 应用程序,并有一个指向外部 html 页面的 ajax 链接。当有互联网连接时,该链接工作正常,但当连接不可用时,则不会出现“正在加载”消息。

这应该是 jqtouch 中的默认行为吗?如果是这样,什么可能导致图像不显示?

感谢您的帮助

I'm creating a web app using jqtouch and have an ajax link to an external html page. The link works fine when there is internet connectivity, but when the connection is not available, there is no "loading" message.

Should this be a default behavior in jqtouch? If so, what could be causing the image to NOT display?

Thanks for your help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我们的影子 2024-09-19 13:17:37

嗯,我自己做的。

JS 代码:

$(function(){
    $('#link').tap( function(e){
        $('#myloading').css("display","");
        window.location = this.href;
        return false;
    });
    $('#myloading').center();
});
jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
    this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
    return this;
}

并在页面上放置一个 div:

<div style="display:none;" id="myloading">
    <img src="/css/jqtouch/apple/img/ajax-loader.gif" />
</div>

以及所有外部链接,如:

<a id="link" href="page.html">My links</a>

结论:

我将所有链接转换为在点击事件上工作。

我希望它能解决你的问题。

Well I done it by my own.

JS code:

$(function(){
    $('#link').tap( function(e){
        $('#myloading').css("display","");
        window.location = this.href;
        return false;
    });
    $('#myloading').center();
});
jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
    this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
    return this;
}

And put a div on the page:

<div style="display:none;" id="myloading">
    <img src="/css/jqtouch/apple/img/ajax-loader.gif" />
</div>

And all external links like:

<a id="link" href="page.html">My links</a>

Conclusion:

I convert all links to be worked on tap event.

I hope it solves your problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文