blueimp / Gallery

blueimp Gallery is a touch-enabled, responsive and customizable image & video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. It features swipe, mouse and keyboard navigation, transition effects, slideshow functionality, fullscreen support and on-demand content loading.
https://blueimp.github.io/Gallery/
Other
3.76k stars 984 forks source link

closeOnSlideClick not work with blueimp-gallery-contain #259

Open leadenhead opened 3 years ago

leadenhead commented 3 years ago

Hello! Actually, I found this behavior: closeOnSlideClick: true not work with blueimp-gallery-contain Is this a bug or should it be? Thanks!

blueimp commented 3 years ago

It's an implementation detail. 😬

The CSS code applied to images with this class sets the img element dimensions to the full size of the container (even though the actual image is not necessarily covering the whole container):

width: 100%;
height: 100%;
object-fit: contain;

Since the click on the image itself is already reserved to toggle the display of the controls, I'm not sure how to fix this easily unfortunately.