canvas使用
发布于 6 年前 作者 mcui 18351 次浏览 来自 问答

对canvas使用position: fixed,但是对canvas内部的图形貌似不生效?会跟着屏幕滚动。请教有谁遇到过?怎么解决?

2 回复

<canvas  disable-scroll=“true” bindtouchstart=“touchStart” bindtouchmove=“touchMove” bindtouchend=“touchEnd” canvas-id=“myCanvas” />

在canvas里添加disable-scroll="true" bindtouchstart="touchStart" bindtouchmove="touchMove" bindtouchend="touchEnd"

这段即可

回到顶部