Skip to main content

Questions tagged [hammer.js]

Hammer is an open-source library that can recognize gestures made by touch, mouse and pointerEvents. It has support for multiple instances the same time, so you can start creating multi-user touch interfaces.

hammer.js
285 votes
8 answers
400k views

Consider marking event handler as 'passive' to make the page more responsive

I am using hammer for dragging and it is getting choppy when loading other stuff, as this warning message is telling me. Handling of 'touchstart' input event was delayed for X ms due to main ...
Matt's user avatar
  • 34.7k
106 votes
10 answers
87k views

Angular - 'Could not find HammerJS'

I'm working on a simple angular project where I am trying to import Material Design into my project but some of the components aren't working properly and a console warning says: Could not find ...
Danoram's user avatar
  • 8,301
42 votes
5 answers
62k views

Pinch to zoom using Hammer.js

I am trying to implement pinch to zoom using hammer.js Here's my HTML- <script src="//cdnjs.cloudflare.com/ajax/libs/hammer.js/1.0.5/hammer.min.js"></script> <div id="pinchzoom"> ...
nickalchemist's user avatar
12 votes
6 answers
27k views

Using mobile events in Angular2

I was wondering if I could get some help in regards to events for mobile devices. I was looking around for a way to bind functions to swipe events in Angular 2. I saw in this this issue on Github that ...
Eric Gonzalo's user avatar
8 votes
3 answers
6k views

Javascript touch movement, track when user swipes from edges

I need to track user touch events. I want to track when user swipes from edges. For example when user swipes from left vertical edge I will show a menu, from right edge make an alert, and show another ...
trante's user avatar
  • 33.8k
6 votes
4 answers
16k views

Configure Hammerjs events with angular2

How can I configure hammerjs events in angular2? To use hammerjs events with angular2 I just have to include events on my html like this: <div (press)="onLongPress($event)"></div> In ...
afvieira's user avatar
17 votes
2 answers
13k views

hammer.js object has no method addEventListener

I am getting the Error: Uncaught TypeError: Object [object Object] has no method 'addEventListener' hammer.js:168 my code is like this: <script type="text/javascript" src="js/hammer.js"></...
hdayi's user avatar
  • 443
12 votes
4 answers
27k views

How to use hammer.js with Angular.js

I'm new with Angular.js and reading i know angular dont have events like tap, double tap, etc. I'm trying to combine with Hammer.js without success. Code from gist /** * angular-hammer.js * ...
rkmax's user avatar
  • 18k
6 votes
1 answer
4k views

Hammer JS not working with backbone

I'm trying to get hammer js events working with backbone but can't get it to respond to events. I've tried the following already.. http://cijug.net/tech/2013/01/16/backbone-hammer/ https://gist....
user1184100's user avatar
  • 6,874
5 votes
2 answers
15k views

Removing hammer events

I create an event using hammer.js library like this: Hammer(myElement).on("doubletap", function(evt){ evt.preventDefault(); }); How can I then remove the registred event? Can I ...
Jacob's user avatar
  • 3,870
2 votes
4 answers
7k views

Hammer.js can't remove event listener

I create a hammer instance like so: var el = document.getElementById("el"); var hammertime = Hammer(el); I can then add a listener: hammertime.on("touch", function(e) { console.log(e.gesture); }...
George Reith's user avatar
  • 13.3k
1 vote
2 answers
2k views

jQuery functions not working with Hammer.js

I am trying to add press to jQuery selector. I have many elements on same document, So I can not use IDs for each. I tried by $(selector)[i] as like explained here. var selectProduct = $('.mh60 a'); ...
Madan Bhandari's user avatar
33 votes
5 answers
12k views

Vertical scroll is not working with HammerJS and Angular2

I'm having a problem using the HammerJS with Angular2. I have a carousel (based on the bootstrap carousel with Angular2 event handlers) where I'm listening to the swipe left and swipe right events. ...
user1511408's user avatar
14 votes
1 answer
4k views

App won't recognize swipes using Hammer.JS and HammerGestureConfig in Angular 9

I can't recognize swipes in my Angular app using Hammer.JS. It's setup like this: "@angular/core": "~9.0.0-next.6", "hammerjs": "^2.0.8", "zone.js": "~0.10.2" app.module.ts is looking like this: ...
lampshade's user avatar
  • 2,656
11 votes
5 answers
27k views

stopPropagation() with tap event

I'm using hammer.js and it appears that I event.stopPropagation() doesn't work with tap event. If I click on the child, the associated event is triggered but parent's event is also triggered and I ...
TimPetricola's user avatar
  • 1,491

15 30 50 per page