I have this custom slider
https://stackblitz.com/edit/angular-ivy-airvm5?file=src/app/app.component.css
On Next and Previous buttons clicks images are getting changes from images array but main issue is when we click on next button while translating the next and previous button position are changed to top, but here i want when i translate as different slides will have different height of images so next and previous button should automatically positioned according to the height of images. I was trying to give margin top also
let currentMargin = parseInt(this.nextdiv.nativeElement.style.marginTop);
if(isNaN(currentMargin)){
currentMargin = 0;
}
let newMargin = currentMargin + 70;
this.next.nativeElement.style.marginTop = newMargin+'px';
screenshot: