小程序·使用echarts不跟隨父元素滑動的問題


微信echarts文檔鏈接:https://github.com/ecomfe/echarts-for-weixin

echarts官方文檔:https://echarts.apache.org/zh/index.html

剛添加echarts的時候:

 

 

 滾動頁面的時候:

 

 

1. 當時百度了很多辦法有大神說是因為echarts的默認觸碰值的問題

bindtouchstart="touchStart"

bindtouchmove="touchMove"

bindtouchend="touchEnd" 

去掉這幾個默認的方法就行了 但是在我這並不適用

2.使用disable-scroll="true"

在界面的遮罩層添加disable-scroll="true" 在我這也不適用

3.查看canvas的層級是否使用了height="100%",position定位 只要是canvas的父級元素都不能添加

檢查元素發現沒有使用這些樣式 最后發現在page上設置了height="100%" 這個需要注意下

小程序的echarts用的是canvas所以層級最高 使用z-index無效,所以需要覆蓋echarts需要使用cover-view或cover-image;

查找的相關文章:https://blog.csdn.net/xd_yangxiaoromg/article/details/88258744?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.nonecase

 


免責聲明!

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



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