I need to write a handler for a click or a touch event. I've done lots of click handlers before, using the jQuery onHandler extensions. But this extension doesn't have any touch events in the drop down.
Do I need to use raw JS extensions to manage these clicks/touch events? Or is there a way to capture touch events using Tealium extension templates?
So if you want to use jQuery there is a module for mobile you can use.
If you want to use native JS, you can do something like:
var el = document.getElementById("myBtn"); el.addEventListener("touchstart", handleStart, false); el.addEventListener("touchend", handleEnd, false); el.addEventListener("touchcancel", handleCancel, false); el.addEventListener("touchmove", handleMove, false);
However, to note, the
click event will be triggered as well, like a normal mouse click.