I have to develop an app like inshorts animation effect . I have successfully done this in cordova but i’m not able to do it in ionic3. I have gone through a lot of solutions on internet but didn’t find what I’m looking for.
<ion-content padding>
<ion-card color="primary" swiper (onSwipeUp)="swipeUp($event)" (onSwipeDown)="swipeDown($event)" (onSwipeLeft)="swipeLeft($event)" (onSwipeRight)="swipeRight($event)">
</ion-card>
<ion-card color="secondary" swiper (onSwipeUp)="swipeUp($event)" (onSwipeDown)="swipeDown($event)" (onSwipeLeft)="swipeLeft($event)" (onSwipeRight)="swipeRight($event)">
</ion-card>
</ion-content>
The swipe is working, i’m able to capture the swipe event with hammerjs but I’m not able to add the transition on the card dynamically.
I have done that in cordova with the below block of code but not able to do with ionic.
function scrollImages(distance, duration, selectorId) {
console.log(distance);
var r = $.Deferred();
$('#'+selectorId).css("transition-duration", (duration / 1000).toFixed(1) + "s");
var value = (distance < 0 ? "" : "-") + Math.abs(distance).toString();
$('#'+selectorId).css("transform", "translate(" + value + "px,0)");
}