First, initialize a PointerListener instance. This will active gesture detection on the domElement of your choice.
constdomElement=document.getElementById("idOfElement");constpointerListener=newPointerListener(domElement,options);domElement.addEventListener("tap",function(event){// do something on tap});
By default, all recognizers are active and their events are fired accordingly.
Also the viewport meta tag is recommended to scale the screen correctly. You do not have to add user-scalable=no or maximum-scale=1. Default browser gestures (pinch to zoom) can be prevented by adding touch-action:none to the domElement in css.
If you initialize PointerListener with document.body as the domElement, you will be able to access contactjs events on all elements.
constpointerListener=newPointerListener(document.body,options);constanyDomElement=document.getElementById("idOfElement")anyDomElement.addEventListener("tap",function(event){// do something on tap});