Disable lightbox for mobile?Browser Info Environment
can you please tell me what would be best practice to disable the lightbox for mobile on a custom template, in order to show only thumbnails (one column) on screens with max-width 420px for example?
Plz upgrade to latest version (2.4.0) which include an option for disable lighbox on the mobile devices.
The only 'problem' is, that it doesn't work dynamically:
if a gallery is viewed on a smartphone in landscape mode, where the lightbox still makes sense (mobile width set to 480px for example) and the device is turned, switching to portrait mode, the lightbox is still active.
Same behavior of course is true for the other way round:
Using a smartphone in portrait mode, one may like to view images in the lightbox, but after switching to landscape mode, this is still not possible, except for the page is reloaded.
Of course i understand, if there is no dynamic solution for detecting changing screen widths in JS as things work in CSS with media queries.
it's great that you implemented the option to disable the lightbox for mobile screens.
Unfortunately, while it should be possible to set a custom value for maximum screen width up from 0 (which should completely disable it), there is still a value of 600 hardcoded in controller.php of the block. I don't know if this is intentionally, or just a leftover of a previous version. It seems that this value does not get overridden by custom values less than 600 pixels. If, for example, a custom width of 320 pixels is set for a gallery block, the lightbox will still be disabled on screen widths of equal or less than 600 pixels.
Only commenting out the code on line 742 of the block's controller.php solved the problem:
// $this->gallery->optionsObj->lInactiveonMobile = 600;
Yep, I forgot to remove that line. Thanks for the heads-up.