kolkov / ngx-gallery

A simple responsive native gallery component for Angular 8+.
https://ngx-gallery.kolkov.ru/
MIT License
115 stars 56 forks source link

Open preview select next image #16

Open ironista opened 4 years ago

ironista commented 4 years ago

I have a gallery with two images. When I click the thumbnail of first image, preview shows the next one (second image). I thinks preview index is not aligned with the thumbnail one. Could you check please?

Here are my settings and code:

"dependencies": {
    "@angular/core": "~9.1.0",
    "@kolkov/ngx-gallery": "^1.0.11"
}
  ngOnInit() {
    this.galleryOptions = [
      {
        "thumbnails": false,
        "previewCloseOnClick": true,
        "previewCloseOnEsc": true,
        "width": "100%",
        "height": ""
      },
    ];
   ...
  }

private updateGalleryImages() {
    if (this.fullMeasurementProject && this.fullMeasurementProject.measurementProject) {
      const right = this.fullMeasurementProject.measurementProject.pictureRight;
      const left = this.fullMeasurementProject.measurementProject.pictureLeft;

      const smallWidth = 240;
      const mediumWidth = 480;

      this.galleryImages = [
        {
          small: this.measurementService.getImageUrl(right, smallWidth),
          medium: this.measurementService.getImageUrl(right, mediumWidth),
          big: this.measurementService.getImageUrl(right)
        },
        {
          small: this.measurementService.getImageUrl(left, smallWidth),
          medium: this.measurementService.getImageUrl(left, mediumWidth),
          big: this.measurementService.getImageUrl(left)
        }
      ]
    }
  }

The measurementService is not responsible for inversion.

raffaelfoidl commented 4 years ago

I encountered this issue as well. To me, this happens when imageAnimation is set to something different than NgxGalleryAnimation.Slide. For Slide it works as intended.

ironista commented 4 years ago

I encountered this issue as well. To me, this happens when imageAnimation is set to something different than NgxGalleryAnimation.Slide. For Slide it works as intended.

Same for me. Thank you.

julianosouzanh commented 4 years ago

I'm also problem with NgxGalleryAnimation.Slide, preview select next image

kolkov commented 4 years ago

by and large, everything would have to be rewritten there ...

pushprajkiwitech commented 3 years ago

Same problem, is there any solution, please provide any one have any solution.

edarioq commented 3 years ago

Same issue, setting imageAnimation: NgxGalleryAnimation.Slide fixes it as @raffaelfoidl says. Using Angular 11.