简体   繁体   English

页面加载之前的Jquerymobile加载微调器对话框

[英]Jquerymobile Loading spinner Dialog before page is Loaded

In my app I have 3 pages from the first page I am sending data to server, here I want to show a Loading dialog until the send operation (posting to server) is finished and then go to page two. 在我的应用程序中,从首页发送数据到服务器有3页,在这里我想显示一个“加载”对话框,直到发送操作(发送到服务器)完成,然后转到第二页。 Doing a below but it's not working 做一个下面,但不能正常工作

<script type="text/javascript">
$(document).on('pageshow', '#Page2' ,function () {
  setTimeout(function () {
   $.mobile.changePage('#dialog');
  }, 100); // delay above zero
});
</script>

Try2 尝试2

<script>  
    $(document).on("pagecreate","#page", function () {
    $("#custom-li").on("click", function () {
   var orgname = $('input:text[id=name]').val();

    loadingStart();
    setTimeout(function () {
        loadingEnd();
        $.mobile.changePage('#page2');
    }, 3000);
    return false;
   });       
});
function loadingStart() {
    $.mobile.loading('show', {
        text: "loading",
        textVisible: true
    });
}
function loadingEnd() {
    $.mobile.loading("hide");
}
</script>

the function is firing but the spinner is missing from the dialog when I run in browser and mobile. 该功能正在触发,但当我在浏览器和移动设备上运行时,对话框中缺少微调框。

Any help is appreciated. 任何帮助表示赞赏。

So is only spinner missing? 那么,只有微调框丢失了吗? In this case, maybe you don't have "images/ajax-loader.gif" at html files directory. 在这种情况下,也许您在html文件目录中没有“ images / ajax-loader.gif”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM