let hammerEle = document.body
let mc = new Hammer.Manager(hammerEle, {
preventDefault: false,
domEvent: true,
touchAction: 'auto'
})
let pinch = new Hammer.Pinch()
mc.add(pinch)
mc.get('pinch').set({ enable: true, direction: Hammer.DIRECTION_ALL })
mc.on('pinchend', function (ev) {
alert('pp')
})
hammer.js初始化
最新推荐文章于 2020-05-24 11:13:41 发布