仅在jquery mobile中加载所有图像时显示下一页

时间:2011-11-15 13:25:56

标签: jquery-mobile

是否有任何简单的方法或设置我可以通过jquery mobile启用它?

我只是使用普通的锚链接在页面之间导航并让jquery移动默认行为适用,但问题是当下一页显示时,页面会闪烁。

我想避免这种情况 - 此外我还希望仅在包含其图像的整个页面已加载时才显示下一页。为我的应用程序带来更好的体验。

1 个答案:

答案 0 :(得分:0)

你可以尝试

$(window).load(function() {
    // do stuff when the entire doc and all assets have been loaed
});

或:http://jquerymobile.com/demos/1.0rc3/docs/api/events.html

$( 'div' ).live( 'pageshow',function(event, ui){
    alert( 'This page was just hidden: '+ ui.prevPage);
});

更新

$( '#pageNameHere' ).live( 'pageshow',function(event, ui){
    $(window).load(function() {
        // do stuff when the entire doc and all assets have been loaed
    });
});