Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/jquery-mobile/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery mobile 在文档准备就绪时显示加载程序_Jquery Mobile - Fatal编程技术网

Jquery mobile 在文档准备就绪时显示加载程序

Jquery mobile 在文档准备就绪时显示加载程序,jquery-mobile,Jquery Mobile,如何在文档准备就绪时显示加载程序。上面的代码没有任何作用 $(document).bind("pageinit", function() { $.mobile.loading("show"); }); 这可能会帮到你 JavaScript代码 $(document).on('pagebeforeshow', '#index', function(){ }); $(document).on('pagebeforeshow', '#second',

如何在文档准备就绪时显示加载程序。上面的代码没有任何作用

$(document).bind("pageinit", function() {
   $.mobile.loading("show");             
});
这可能会帮到你

JavaScript代码

$(document).on('pagebeforeshow', '#index', function(){       

});

$(document).on('pagebeforeshow', '#second', function(){       

});
HTML代码

<!DOCTYPE html>
    <html>
        <head>
            <title>jQM Complex Demo</title>
            <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no; target-densityDpi=device-dpi"/>
            <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
            <style>

                .ui-loader-default {
                    opacity: 1 !important;      
                }

                .custom-spinner {
                    width: 37px !important;
                    height: 37px !important;
                    background-image:url('http://pictures.reuters.com/ClientFiles/RTR/Images/ajax-loader.gif');
                    display: block;
                }
            </style>
            <script type="text/javascript" src="http://www.dragan-gaic.info/js/jquery-1.8.2.min.js"></script>
            <script>
                $( document ).bind( 'mobileinit', function(){
                    $.mobile.loader.prototype.options.text = "loading";
                    $.mobile.loader.prototype.options.textVisible = false;
                    $.mobile.loader.prototype.options.theme = "a";
                    $.mobile.loader.prototype.options.html = "<div class='custom-spinner'></div>";
                }); 
            </script>       
            <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>    
            <script>
                $(document).on('pageshow', '#index', function(){        
                    $.mobile.loading( 'show');          
                }); 
            </script>
        </head>
        <body>
            <div data-role="page" id="index">
                <div data-theme="a" data-role="header">
                    <h3>
                        First Page
                    </h3>
                    <a href="#second" class="ui-btn-right">Next</a>
                </div>

                <div data-role="content">

                </div>

                <div data-theme="a" data-role="footer" data-position="fixed">

                </div>
            </div> 
        </body>
    </html>   

jQM复杂演示
.ui加载程序默认值{
不透明度:1!重要;
}
.定制微调器{
宽度:37px!重要;
高度:37px!重要;
背景图像:url('http://pictures.reuters.com/ClientFiles/RTR/Images/ajax-loader.gif');
显示:块;
}
$(文档).bind('mobileinit',function(){
$.mobile.loader.prototype.options.text=“加载”;
$.mobile.loader.prototype.options.textVisible=false;
$.mobile.loader.prototype.options.theme=“a”;
$.mobile.loader.prototype.options.html=“”;
}); 
$(document).on('pageshow','#index',function(){
$.mobile.loading('show');
}); 
首页
HTML

<div id="spinner" style="display: none;">
<span id="ss" style="float: left; margin-left: 50% !Important; margin-top: 22% !Important;">
<img src="ajax-pink-loader.gif" alt="Loading..." />
</span>
</div>
<asp:Button ID="ssubmit" runat="server" Text="Search" OnClick="submit_Click1" />
CSS

<style type="text/css">
        #spinner
        {
            background: rgb(0, 0, 0);
            background: rgba(0, 0, 0, .5) !important;
            filter: alpha(opacity=60) !important; /* IE */
            -moz-opacity: 0.6 !important; /* Mozilla */
            opacity: 0.6 !important; /* CSS3 */
            top: 0;
            left: 0;
            position: fixed;
            height: 100% !important;
            width: 100% !important;
            _height: expression(document.body.offsetHeight + "px");
            z-index: 9999;
        }
    </style>

#纺纱机
{
背景:rgb(0,0,0);
背景:rgba(0,0,0,5)!重要;
过滤器:alpha(不透明度=60)!重要;/*IE*/
-moz不透明度:0.6!重要;/*Mozilla*/
不透明度:0.6!重要;/*CSS3*/
排名:0;
左:0;
位置:固定;
身高:100%!重要;
宽度:100%!重要;
_高度:表达式(document.body.offsetHeight+“px”);
z指数:9999;
}

请提供更多详细信息
<style type="text/css">
        #spinner
        {
            background: rgb(0, 0, 0);
            background: rgba(0, 0, 0, .5) !important;
            filter: alpha(opacity=60) !important; /* IE */
            -moz-opacity: 0.6 !important; /* Mozilla */
            opacity: 0.6 !important; /* CSS3 */
            top: 0;
            left: 0;
            position: fixed;
            height: 100% !important;
            width: 100% !important;
            _height: expression(document.body.offsetHeight + "px");
            z-index: 9999;
        }
    </style>