JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//cdnjs.cloudflare.com/ajax/libs/hammer.js/1.0.5/hammer.min.js"></script>
<div id="el">
You can touch this!
</div>
CSS
body, html {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
#el {
width: 100%;
height: 100%;
background: #FF0000;
}
JavaScript
var el = document.getElementById("el");
var hammertime = Hammer(el);
hammertime.on("touch", function(e) {
console.log("That tickles!");
hammertime.off("touch");
});