Duplicated gallery overlays (I wanted to go back to first photo when opening the 'show more photos')
azuxx opened this issue · comments
Andrea Zorzi commented
Description
I wanted to go back to first photo when opening the 'show more photos' but two fullscreen overlays are shown instead of just the above one.
TS/HTML code on Angular project
lightGallerySettings: LightGallerySettings = {
counter: false,
licenseKey: environment.lightGalleryLicenseKey,
plugins: [lgZoom]
};
playFromStartingSlide() {
const lg = document.getElementById('activity-details-light-gallery');
if(lg){
// Get the plugin instance through the lightGallery main function
const plugin = lightGallery(lg);
plugin.slide(0);
plugin.refresh();
}
}
<ng-template #galleryTpl let-galleryItems="galleryItems" let-hasMultiPreview="hasMultiPreview">
<lightgallery [settings]="lightGallerySettings" class="light-gallery-container" id="activity-details-light-gallery"
[class.light-gallery-container--multi-preview]="hasMultiPreview && galleryItems?.length > 1">
<a [href]="galleryItems[0]?.url">
<img alt="immagine principale gallery" [src]="galleryItems[0]?.url"/>
</a>
<ng-container *ngIf="hasMultiPreview && galleryItems?.length > 1">
<a
*ngFor="let item of galleryItems; let i = index;"
[href]="item.url" [style.display]="i > 3 ? 'none' : 'block'">
<img [src]="item.url" [alt]="'immagine gallery n.'+ i"/>
<button *ngIf="i === 3" mat-stroked-button color="primary" (click)="playFromStartingSlide()">
{{isLowerThanOrEqual1024() ? ('activity-details.show-all' | translate) : ('activity-details.show-all-photos' | translate)}}
</button>
</a>
</ng-container>
</lightgallery>
</ng-template>
Environment
lightGallery 2.7.2 with Angular 15
Screenshots
Could I have your support please?
Kind regards
stale commented
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.