I have multiple tabs for users to switch between. For mobile users ideally they could swipe left/right and see the information on each tab. How can I do this in an aura page? I tried it a variety of ways but aura seems to only support regular clicks.
0
-
You need to use touch events. Have you tried that? Where did you get stuck? – sfdcfox Nov 13 at 1:39
-
use touchpunch netcu.de/jquery-touchwipe-iphone-ipad-library – Avijit Chakraborty Nov 13 at 3:14
0
Ok, ended up finding the answer, I used ontouchmove for detecting swipe events, event returns a touch object in an event.touches array
edit:
Index.cmp
<div ontouchmove="{!c.touchmove}"><!--start touchcontainer-->
IndexController.js
touchmove: function(component, event, helper) {
if(!event.touches || event.touches.length == 0)return;
var xmoved = event.touches[0].clientX
//do stuff
},
-
Can you provide the sample code here as how were you able to achieve this? This will be helpful for others in similar situation. – Jayant Das Nov 14 at 14:57