猿问
回到首页
个人中心
反馈问题
注册登录
下载APP
首页
课程
实战
体系课
手记
专栏
慕课教程
canvas
在网上找了一个canvas的代码,pc端浏览器是没有问题的,但是在移动端就不行了,是图中
矩形里面设定的吗?怎么解决
Helenr
浏览 579
回答 1
1回答
万千封印
看了半天看 因为手机端是没有mouse = =this.canvas.onmousedown = function (e) { _this.downEvent(e)}; this.canvas.onmousemove = function (e) { _this.moveEvent(e)}; this.canvas.onmouseup = function (e) { _this.upEvent(e)}; this.canvas.onmouseout = function (e) { _this.upEvent(e)};改为-->this.canvas.addEventListener('touchstart', function (e) { _this.downEvent(e)}); this.canvas.addEventListener('touchmove', function (e) { _this.moveEvent(e)}); this.canvas.addEventListener('touchend ', function (e) { _this.upEvent(e)});试一下~ ps:因为我现在没有服务器测不了~
0
0
0
打开App,查看更多内容
随时随地看视频
慕课网APP
相关分类
JavaScript
继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续