In hammer.js version 1.1.3, I was able to use the following code perfectly:
var button = Hammer(element, {
hold: true,
release: true
});
button .on('hold', function() {
});
button .on('release', function() {
});
But in hammer.js 2.0, I struggle to find the equivalent:
var button = new Hammer.Manager(element);
button.add(new Hammer.Press({
event: 'press',
pointer: 1,
threshold: 5,
time: 500
}));
button.on('press', function(event) {
});
According to the documentation ( http://hammerjs.imtqy.com/getting-started.html ) for the new hammer.js 2.0 there are 5 recognizers:
Pan, Pinch, Press, Rotate, Swipe, Tap
I could not find a suitable recognizer that would allow using functions like release. Any thoughts, suggestions or ideas are welcome. Greetings to read!
source
share