hammerjs / hammer.js

A javascript library for multi-touch gestures :// You can touch this

Home Page:http://hammerjs.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The event object isFirst forever false

amnotbusy opened this issue · comments

`var myElement = document.getElementById('myElement');

// create a simple instance
// by default, it only adds horizontal recognizers
var mc = new Hammer(myElement);

// let the pan gesture support all directions.
// this will block the vertical scrolling on a touch-device while on the element
mc.get('pan').set({ direction: Hammer.DIRECTION_ALL });

// listen to events...
mc.on("panleft panright panup pandown tap press", function(ev) {
console.log(ev.isFirst);//forever false
myElement.textContent = ev.type +" gesture detected.";
});`

Agreed. I'm using pinch event and wanted to set transformOrigin when the first event is triggered. Unfortunately ev.isFirst is always false.