ngx-image-gallery
ngx-image-gallery copied to clipboard
Close gallery on backdrop click (outside of image) when gallery is fullscreen.
Hey. Is It possible to close the gallery on backdrop click when the gallery is full screen?
@cangec This is possible in case of social media dialog post where only close button lies outside a bounding box. Since this gallery takes entire screen area and many things are outside image area which are important to interact with, I am not sure whether we can add this feature at this moment.
this.elementRef.nativeElement.querySelector('#ngx-gallery').addEventListener('click', e => { if(!(e.target.closest('img')) && !(e.target.closest('.control')) && !(e.target.closest('.thumbnail'))){ this.closeGallery(); } });
This worked for me. I gave the gallery an id of 'ngx-gallery' to select it easier.
Hi ! Any news about this functionality ?