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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -