开发者

jqtouch - no loading image appears

I'm creating a web app using jqtouch and have an ajax link to an external html pag开发者_开发技巧e. 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜