开发者

How to block UI using pageLoading in jQueryMobile

Is it pos开发者_JAVA百科sible to block the UI when using $.mobile.pageLoading(false)?


This feature isn't implemented in jQueryMobile Alpha 1.0a4.1.

I solved the problem adding a overlay div with high enough z-index.

JS:

$(document).ready(function () {         
    $('body').append('<div id="block-ui"></div>');      

    $('#ajax_request').click(function(){        
        $('#block-ui').show();
        $.mobile.pageLoading(false);
    });
});

CSS:

#block-ui {
    display: none;
    cursor: wait;
    position: absolute;
    top: 0px;
    left: 0px;  
    width: 100%;
    height: 100%;
    z-index: 9; 
    background-color: #CCCCCC;
    opacity: 0.5;
}

If you're using using fixed-bars you need to override z-index value:

.ui-header-fixed, .ui-footer-fixed {
    z-index: 8 !important;
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜