javascript - Ionic reset panning value -
i want reset panning value. basicly want todo when value hits -130 should put panning value 0 again.
my code:
swipeevent($e) { if ($e.deltax <= -130) { document.getelementbyid("button").click(); console.log('swiped left') }; if ($e.deltax < -131) { $e.deltax == 0 } }
i tried code already:
if ($e.deltax < -131) { $e.deltax = 0 }
sadly didn't worked.
could me please ? regards!
i fixed it!
i had change html this:
<div class="cards" (pan)='swipeevent($event)'>
to this:
<div class="cards" (swipe)='swipeevent($event)'>
ts:
swipeevent($e) { if ($e.deltax <= -130) { document.getelementbyid("button").click(); console.log('swiped left') }; }
hope helps in future!
Comments
Post a Comment