2014-01-05 125 views
1

我爲我的iOS應用使用phonegap。電話頁面之間的白色閃爍/閃光iOS

由於某些原因,當我瀏覽我的應用程序時,頁面之間會出現白色閃爍/閃爍一秒鐘。

我沒有使用jquery mobile,我只使用了一些javascript和iScroll4。無論如何解決這個問題?

EDITED
這裏是代碼的一部分。

指數CSS:

body { 

-webkit-user-select: none; 
-webkit-touch-callout: none; 
background-color: #f7f6ec; 
overflow-y: scroll; 
-webkit-overflow-scrolling: touch; 
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); 
} 

#fixedcontent { 
    position:absolute; z-index:1; 
    top:64px; bottom:49px; left:0; 
    width:100%; 
    overflow:auto; 
} 

的Index.html

<html> 
    <head> 


     <script type="text/javascript" src="cordova.js"></script> 
     <link rel="stylesheet" type="text/css" href="css/index.css" /> 


     <!-- fixed header --> 
     <script src="js/iscroll-lite.js"></script> 
     <script type="text/javascript"> 

      var myScroll; 
      function loaded() { 
       setTimeout(function() { 
          myScroll = new iScroll('fixedcontent'); 
          } 

          document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false); 

          document.addEventListener('DOMContentLoaded', loaded, false); 

          function onCompletion() { 
          // Here modify the DOM in any way, eg: by adding LIs to the scroller UL 

          setTimeout(function() { 
            myScroll.refresh(); 
            }, 0); 
          }; 


          </script> 

    </head> 

<body> 
<div id="wrappercontentfixed"> hi test 
<a href="about.html"> about page </a> 
<a href="merchandise.html"> merchandise page</a> 

</div> 
</body> 
</html> 
+0

任何時候dom發生變化時,您都會記得在超時myScroll.refresh()後調用的加載函數。你如何處理鏈接上的「頁面間」動作點擊? – Bernhard

+0

對不起,因爲我是編程人員的初學者,所以我並不是很懂。我已經在html部分編輯了一些。我只是通過正常的鏈接鏈接頁面,例如我的關於頁面只包含HTML/CSS代碼,我的主頁和頁面之間仍然存在閃爍/閃爍。 – user3042348

回答

0

有很多的爲可能的原因。 也許這是webkit-tap-highlight-color你可以在css中更改爲rgba(0, 0, 0, 0),以顯示閃爍效果的元素。

+0

感謝您的回覆!我已經嘗試過了,但它無法工作,頁面之間仍然存在閃光。我已經在我的index.css主體中添加了。 – user3042348

+0

發表一段代碼讓大家都瞭解你做了什麼 – Bernhard

+0

完成!編輯我的帖子。 – user3042348