Search code examples
imageionic2sliderzoominggallery

Disable swiper if image zoomed in ionic 2


I have slides that contains only images. The zoom function not work correctly and I think the problem from slide swiper. So that, I want to disable swiping if my current image in zoom

This is my html code

<ion-slides pager='false' zoom='true' spaceBetween='5'>
    <ion-slide *ngFor="let noteImg of notesImagesList | async">
        <div class="swiper-zoom-container">
            <img src="{{noteImg.url}}">
        </div>
    </ion-slide>
</ion-slides>

Important Note I'm not sure is the problem of zooming the images from slides swiper or not but if not, wish u learn me how can I make my slides support zooming without problems such as the gallery of phone (if possible)


Solution

  • We use ion-slides together with ionic-img-viewer and that works without problems.

    <ion-slides pager='false' zoom='true' spaceBetween='5'>
        <ion-slide *ngFor="let noteImg of notesImagesList | async">
            <img src="{{noteImg.url}}" imageViewer="{{noteImg.url}}">
        </ion-slide>
    </ion-slides>