- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
04-17-2018 07:57 AM
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?
04-19-2018 05:23 AM
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.
Adrian
Copyright All Rights Reserved © 2008-2023