2013-10-29 66 views
1

我開發了一個phonegap應用程序,我使用了多頁面模板,如page1.html,page2.html。每個頁面都擊中服務器並呈現輸出並在列表視圖中顯示它。所以問題是如果我打到從一個頁面重定向到另一個頁面意味着它顯示白屏。避免在jQuery手機中閃爍(白色屏幕)

而且我在嘗試谷歌搜索時嘗試了很多可能的方法。但這對我沒有幫助。

My code is given below: 
$('#content').append('<div class="wholediv"><span class = "wholediv_content"><a style="text-decoration:none!important;"href="'+v.pagename+'.html?id='+v.nodeId +'&catname='+ v.pagecat +'" data-ajax="false">'+'<img src="http://www.examole.com/'+image+' " class="eventsimages" alt = "image"/>'+'<br /><p>'+v.pagename+'</p></a></span></div>'); 

index.html: 

<div data-role="page"> 

      <div data-theme="a" data-role="header" data-position="fixed" data-tap-toggle = "false" style="height:45px;"> 
       <h3 id = "title"> 
        Moble 
       </h3> 
       <span class="off new_off" id = "off" >Off</span> 
      </div> 

       <div data-role="content" id="content"> 

      </div><!-- /content --> 


     </div><!-- /page --> 
    </body> 

我需要避免閃爍。請我做了很多搜索,並應用了所有那些對我沒有幫助的答案。如果我使用數據轉換手段,我需要刪除data-ajax="false"。該怎麼辦?

+0

看看這裏http://stackoverflow.com/questions/17328832/jquery-mobile-page-transitions-flickering-separate-pages –

+0

是我做了它,但它並沒有幫助我..你可以告訴我一些其他的解決方案 – Ram

回答

2

雙閃爍或雙閃是一個衆所周知的問題。

Rob發佈的解決方案實際上是有效的。

設置您的郵件css文件:

.ui-page { 
    -webkit-backface-visibility: hidden; 
} 

使用此在您的視口代碼藏漢:

user-scalable=no 

我犯了一個基本模板的PhoneGap。使用Jquery mobile等等。

http://www.codemonkey.mobi/guides/base.zip

我沒有看到我的基地任何whitescreens。

讓我們知道這是否適合你。

也試試這個:

http://blog.hackedexistence.com/phonegap-jquery-mobile-white-screen-flicker-solved

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 
<meta name="apple-mobile-web-app-capable" content="yes" /> 
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> 
+0

嗨,先生,我已經在我的應用程序和metaname中使用這個類,但它沒有奏效。第二閃爍的一小部分。 – Ram

+0

ok嗯..你確定它不只是你所指的基本過渡嗎? JQM確實在頁面上有300毫秒的延遲。也許這就是你所看到的。 :) – Daniel

+0

我添加了一些更多的東西給我的答案嘗試一下。 – Daniel