Lightbox Responsive view

Hi there,

I’ve built an acf-gallery and integrated the lightbox-shortcode into the mec single template. Works fine so far, but dependiing on the original image at about 640px downwards looks a bit messy. Landscape images are wider than viewport-width and prev and next images are overlapping.

I started adjusting with css:

@media only screen and (max-width: 640px) {
	.ilightbox-holder.light {
    	width: 80vw!important;
    	background: transparent;
    }
    .ilightbox-holder.light:not(.ilightbox-prev):not(.ilightbox-next) {
    	    	left: 10vw!important;
    }
    .ilightbox-holder.light:not(.ilightbox-prev):not(.ilightbox-next) .ilightbox-container {
    	width: 100% !important;
    }
    .ilightbox-holder.light:not(.ilightbox-prev):not(.ilightbox-next) .ilightbox-container img {
    	-o-object-fit: contain;
		object-fit: contain;
		-o-object-position: center center;
		object-position: center center;
		font-family: 'object-fit: contain; object-position: center;';
		width: 100%!important;
		height: 100%!important;
    }
}

Result is this:

looks better but (of course) messes with transitions. So before I go on styling the whole thing I wanted to ask if you came across this issue before and maybe already solved it. Or maybe it would work but something is interfering with the output?

Would be great if you could share your experience on that matter with me :slight_smile:

Cheers Patrik

PS: Out of curiosity: is there a reason why the prev and next buttons are set to display: none by default?
(.ilightbox-toolbar.light a.ilightbox-prev-button, .ilightbox-toolbar.light a.ilightbox-next-button)

Hey @BuzzStory,

Please note that we do not provide theme customization as part of theme support. I’m sorry but we could not provide enhancement to your code.

The lightbox view that you should be getting is like the picture below regardless of stack.

There might be a 3rd party or custom code conflict on your end. Would you mind deactivating all 3rd party plugins and temporarily remove all custom codes and see how your lightbox looks? Please also do the rest of the troubleshooting steps below that’s applicable to your setup

  1. Testing For Plugin Conflict
  2. Child Theme
  3. Css/Js Customization

Only if none of that helps, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin username and password

You can find the Secure Note button at the bottom of your posts.

Thanks.

Hey @christian,

thank you for your reply!
I’m aware that you do not provide theme customization and I totally understand that.

So in order to find the reason for the behavior of the lightbox on my site I set up a fresh install on a different server to check how it behaves without any customizations on my part. Only thing I did is set the Content Layout to Fullwidth in Theme-Options and change WP language to german.

Details on Install:
Wordpress V. 5.6
Pro V. 4.0.11
No Child theme
No Plugins activated

This Site:
https://b9ny8c4.myraidbox.de/sample-page/

I used the following shortcodes in both a Text Element and in a Content Area Element to see if that makes a difference (it didn’t):

[image class="folio-1" src="/wp-content/uploads/2021/01/kafka-ortweinplatz-scaled-e1598526355418.jpg" link="true"]
[image class="folio-1" src="/wp-content/uploads/2021/01/Gold_C.NestroyTaO_2-scaled-800x600-1.jpg" link="true"]
[image class="folio-1" src="/wp-content/uploads/2021/01/geschichten-vom-gold-ortweinplatz-scaled-e1598526613532.jpg" link="true"]
[image class="folio-1" src="/wp-content/uploads/2021/01/theopposite2-scaled.jpg" link="true"]
[image class="folio-1" src="/wp-content/uploads/2021/01/MG_7889-scaled.jpg" link="true"]
[image class="folio-1" src="/wp-content/uploads/2021/01/MG_1229-scaled.jpg" link="true"]
[image class="folio-1" src="/wp-content/uploads/2021/01/MG_1153-scaled.jpg" link="true"]
[image class="folio-1" src="/wp-content/uploads/2021/01/scarlett-ortweinplatz.jpg" link="true"]
[image class="folio-1" src="/wp-content/uploads/2021/01/nah-ortweinplatz-1.jpg" link="true"]
[image class="folio-1" src="/wp-content/uploads/2021/01/MG_4235-scaled.jpg" link="true"]

[lightbox selector=".folio-1" deeplink="true" opacity="0.875" prev_scale="0.75" prev_opacity="0.75" next_scale="0.75" next_opacity="0.5" orientation="horizontal" thumbnails="true"]

Here is what it looks like at 462px viewport-width:

Also when I check with my iPhoneX lightbox pagination behaves odd…

So i’m not sure whats wrong here since this is the same behavior as on my dev-site I mentioned in the post above.

Hey @BuzzStory,

We have checked and looks like a browser bug and in conflict with touch functionality. Once touch and swiped, the lightbox no longer receives the touch and swipe event rendering the lightbox not usable. And I can’t find any workaround at this moment, but yes, touch event works on other browsers, we’ll continue checking but this issue is lightbox library-related and so something we can’t fix easily.

As an alternative, you can try the Essential Grid extension.
Extension - Essential Grid
Essential Grid Basics

Thanks!

Hey @ruenel!

Thank you very much for the Info!

I’m already using The Grid on my site and it seems a bit heavy to me to additionally install Essential Grid just for a simple image gallery. But thanks for the suggestion.

I worked around with the ACF Justified Gallery Addon for now. But since it’s not compatible with WP 5.6 I really hope there will be a fix some time or I can find another alternative.

Thank you and the team for your great work!

You are welcome @BuzzStory

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.