【问题标题】:Jquery Mobile flicker/white screen in iPhoneiPhone中的Jquery Mobile闪烁/白屏
【发布时间】:2013-02-17 21:54:45
【问题描述】:

经过详细搜索和谷歌搜索,我最终决定提出我的问题。

在我的 JQM 网络应用程序中,共有 4 个页面。其中 2 个是通过 Ajax 动态填充的。我用过

$.extend($.mobile, {
        defaultPageTransition: 'none'
    });

我的动态填充函数是

$.get_detail= function(){
  $.ajax({
    url: "mypage.cfm",
    data: data,
    timeout:5000,
    cache:false,
    type:'GET',
    dataType:"html",
    success: function(data3) {
       //$('#filldiv').empty();
       $("#filldiv").html(data3);
    $.mobile.changePage('#detailpage');
    },
    error: function(statusCode, errorThrown)
    {
    if (statusCode.status == 0) 
        alert("you are offline");
        else
        alert("Please try again.");
    }
        });
    }

当我改变页面时闪烁白屏就像发生了闪烁但是当没有数据填充到 div 时就没有闪烁。我注意到,如果屏幕尺寸没有变化,那么一切都很好,如果屏幕尺寸通过填充动态内容闪烁而发生变化

请帮我解决这个问题。谢谢

【问题讨论】:

    标签: iphone jquery-mobile


    【解决方案1】:

    这是我用来禁用默认转换的方法:

    $(document).on( "mobileinit", function() {
       $.mobile.defaultPageTransition = 'none'; 
    });
    

    最新的 1.4 版也应该有助于更好的过渡。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-17
      相关资源
      最近更新 更多