" LOADING"在JQM页面底部生成的消息 [英] "LOADING" message generated at the bottom of the page in JQM

查看:93
本文介绍了" LOADING"在JQM页面底部生成的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个基本的jqm页面,在页面的末尾,我得到一个带有loading文本的大标签。我见过很多答案,但没有人为我工作。我有这个HTML代码:

I am building a basic jqm page and at the end of the page I am getting a big tag with the text "loading". I have seen a lot of answers but no one working for me. I have this html code:

<!DOCTYPE html>
<html>
<head>
<title>StackMob JS SDK Examples</title>
    <link href="css/bootstrap.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="cordova-1.9.0.js"></script>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery_migrate.js"></script>
    <script type="text/javascript" src="js/jquery_mobile.js"></script>
    <script type="text/javascript" src="js/main.js"></script>
    <script type="text/javascript" src="http://static.stackmob.com/js/stackmob-js-0.7.0-bundled-min.js"></script>   
    <script type="text/javascript">
        $(window).load(function(){
        $.mobile.hidePageLoadingMsg();
        });
    </script>
</head>
<body>
  <div data-role="page"> 
    <div data-role="header">...</div> 
    <input type="button" value="bbbb" id="bb">
    <div data-role="content">...</div> 
  <div data-role="footer">...</div> 
</body>
</html>

这在我的main.js文件中:

and this in my main.js file:

$(window).load(function(){
    $.mobile.hidePageLoadingMsg();
});


jQuery('document').ready(function() {
    $.mobile.hidePageLoadingMsg();
    jQuery('#bb').click(function(){
        $.mobile.hidePageLoadingMsg();  
    });
});

什么都没有用!谢谢!

推荐答案

你需要在mobileinit活动期间这样做:

You need to do it during mobileinit event, like this:

<script type="text/javascript">
    $(document).bind('mobileinit',function(){
        $.mobile.loadingMessage = false;
    })
</script>  

还有一件事,这必须在加载jQuery Mobile之前完成,如下所示:

One more thing, this must be done before jQuery Mobile is loaded, like this:

<head>
    <title>jQM Complex Demo</title>
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0"/>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
    <script type="text/javascript">
        $(document).bind('mobileinit',function(){
            $.mobile.loadingMessage = false;
        })
    </script>    
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>    
</head>

这是一个jsFiddle示例: http://jsfiddle.net/Gajotres/RwRx9/

Here's an jsFiddle example: http://jsfiddle.net/Gajotres/RwRx9/

有关这方面的更多信息,请点击此处: http://jquerymobile.com/demos/1.1.0/docs/api/globalconfig。 html

More about this can be found here: http://jquerymobile.com/demos/1.1.0/docs/api/globalconfig.html

这篇关于&QUOT; LOADING&QUOT;在JQM页面底部生成的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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