简述微信小程序是如何实现手势的各种需求
手势对于对于手机用户的操作体验来说还是非常重要的,尤其是想要一些效果!我们为了实现手势的一些效果,经常使用的是canvas、交互等中应用非常广,今天我们主要来看一下微信小程序手势是如何的实现的。我们主要从以下两个方面来介绍一下微信小程序手势的实现。 上:单触摸点与多触摸点: 来看看微信小程序的手势数据和多触摸点支持 下:编写wxGesture解析类:解析左滑、右滑、上滑、下滑及扩展(下一篇) Demo 为了研究小程序是否支持多手指,需要使用touchstart,touchmove,touchend [AppleScript] 纯文本查看 复制代码 // index.wxml 登录后复制 [AppleScript] 纯文本查看 复制代码 //index.js touchstartFn: function(event){ console.log(event); }, touchmoveFn: function(event){ console.log(event); // console.log("move: PageX:"+ event.changedTouches[0].pageX); }, touchendFn: function(event){ console.log(event); // console.log("move: PageX:"+ event.changedTouches[0].pageX); } 登录后复制 首先,关于单触摸点,多触摸点…