iscroll使用之頁面卡頓問題


      最近在開發項目時,遇到一個問題,使用iscroll實現的頁面滾動,測試時發現在chrome瀏覽器中的模擬移動設備頁面不能平滑滾動,有卡頓現象,在android手機端也有同樣的問題。

      在github上搜索了iscroll的相關問題,以下是對一些覺得對此問題解決有幫助的一些回答的總結。

      解決辦法:通過在head標簽中加<script>window.PointerEvent = undefined</script>中解決了我項目中遇到的問題。

      iScroll具有未記錄的disablePointer設置,可用於以更有序的方式禁用指針事件。傳遞disablePointer:true似乎可以解決最新版本的Chrome的問題。(Chrome 55之前PointerEvents對象不存在)

   我也嘗試了下面的方法,但是只解決了chrome瀏覽器中的卡頓問題,android系統仍然有卡頓現象。

    在iscroll.js v5.2

   更改行298從

   disablePointer:!utils.hasPointer,
   disableTouch:utils.hasPointer || !utils.hasTouch,
   disableMouse:utils.hasPointer || utils.hasTouch,
  以
   disablePointer:true,
   disableTouch:false, 
   disableMouse:true,

 

 

  參考文檔:https://github.com/cubiq/iscroll/issues/1100


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM