canvas使用

发布于 7 年前作者 mcui18524 次浏览最后编辑 7 年前来自 ask

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

2 回复
jing59
jing591 楼6 年前
guiyingqiu
guiyingqiu2 楼5 年前

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

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

这段即可