-
AuthorPosts
-
December 23, 2022 at 1:38 pm #1377213
Hi,
is it possible to disable all links to the lightbox for a certain screen width (mobile)?
Thank you.
Best regards
VeraDecember 23, 2022 at 2:22 pm #1377215Hey Vera,
Thanks for contacting us!
Please add following code to Quick CSS field in Enfold theme options > General Styling tab
@media only screen and (max-width: 480px) { a.lightbox { pointer-events: none; } }
Cheers!
YigitJanuary 3, 2023 at 3:49 pm #1377472Hi,
this didn’t work right away but after adding some classes it works now for the intended screen sizes.
Only under iOs I don’t get it work.
Thanks for help.
Best regards,
VeraJanuary 4, 2023 at 8:32 am #1377554Hi,
Thank you for the update.
On which IOs device are you testing this with? You may need to adjust the css media query above to make it work for that specific device. For iPhone 12 or 13 for example, you can use this css media query.
/* 2340x1080 pixels at 476ppi */ @media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) { pointer-events: none; }
Best regards,
IsmaelJanuary 9, 2023 at 11:07 am #1378013Hi Ismael,
thank you for your update.
I’m using an iPhone SE 2. generation. How do you calculate that?Best regards,
VeraJanuary 10, 2023 at 6:17 am #1378083Hi,
For iPhone SE 2 device, you can use this css media query.
/* 1334x750 pixels at 326ppi */ @media only screen and (max-width: 320px) and (max-height: 568px) and (-webkit-device-pixel-ratio: 2) { a.lightbox { pointer-events: none !important; } } @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2) { a.lightbox { pointer-events: none !important; } }
Best regards,
IsmaelJanuary 10, 2023 at 2:08 pm #1378144Hi Ismael,
sorry for bothering with this issue, but I don’t get it work. Neither with your updated code for SE.
Do you have any further idea?
The opening of the lightbox from an image is perfectly stopped on all mobile devices. Only the lightbox triggered from the slider images isn’t stopping.Best regards,
VeraJanuary 11, 2023 at 7:05 am #1378201Hi,
We mistakenly used min-width and min-height instead of max-width and max-height in the css media query. Sorry about that. Please try the css code again, and make sure to toggle or temporarily disable the Enfold > Performance > File Compression settings afterwards. If the issue persists, please provide the login details in the private field so that we can test the modification.
Best regards,
IsmaelJanuary 13, 2023 at 9:13 am #1378542Hi Ismael,
thank you for the proposal to have a look into the backend. You find the login details below.
The lightbox is still opening from out the sliders in the tab section on most of the iOS mobile devices.Best regards,
VeraJanuary 18, 2023 at 8:27 am #1393867Hi,
We just noticed that we didn’t include the selector in the css code above. We logged in and corrected the code in the Quick CSS field. Please try it again now.
The previous css seems to be working as it should in a browser emulation.
Screenshot: https://1drv.ms/u/s!AjjTfXSRbKTvz1ldwkGM2_ufqVJd?e=8nOXh0
If the issue persists, please try to add this code in the functions.php file.
// custom script: disable lightbox mobile function ava_custom_script_disable_slider_lightbox() { ?> <script type="text/javascript"> (function($) { if(false == $.avia_utilities.isMobile) return; $('.avia-slideshow li a').on('touchstart touchmove touchend', function(e) { e.preventDefault(); }); })(jQuery); </script> <?php } add_action( 'wp_footer', 'ava_custom_script_disable_slider_lightbox', 9999 );
Best regards,
IsmaelJanuary 18, 2023 at 5:47 pm #1393956Hi Ismael,
it works with your additional code for the functions.php file.
Only: now you can’t scroll down the page with/over the images of the slider. And because these images cover most of the surface on the mobile devices it seems that you can’t scroll the page at all.If somehow these modifications exceed your support I would like to engage your freelance department to have somebody take a close look.
On top somehow an old issue is back now in the tab section on mobile devices: the individual height of each tab section seems inaktive when you enter a page. Mike provided a code snippet which worked well but now (suddenly) it doesn’t. (#1377644)
Maybe I (according to the client’s wishes) have created too many issues.
Best regards,
VeraJanuary 20, 2023 at 11:44 am #1394494Hi,
What happens if we remove the “touchmove touchend” events from the script above?
On top somehow an old issue is back now in the tab section on mobile devices:
Please open a different thread about the issue so that we can tackle it in isolation. If you want to look for a freelance developer, please check the link below.
// https://kriesi.at/contact/customization
Best regards,
IsmaelJanuary 22, 2023 at 1:16 pm #1394696Hi Ismael,
thank you for your suggestion but this doesn’t work neither.
Do you have any more ideas? Otherwise I suggest “codeable” to the client if he wants to stick to his wish.
Thank you.Best regards,
VeraJanuary 23, 2023 at 6:21 am #1394734Hi,
Try to replace “touchstart touchmove touchend” with “click”, then add this extra css code.
@media only screen and (max-width: 989px) { .lightbox { pointer-events: none !important; } }
Please make sure to purge the cache afterwards and check the site on incognito mode.
Best regards,
IsmaelFebruary 3, 2023 at 10:00 am #1396527Hi Ismael,
this didn’t work.
But we leave it here. I convinced my client to keep the function as it is.Thank you for your help.
Best regards,
VeraFebruary 4, 2023 at 10:35 pm #1396687Hi,
Sorry we were not able to help with this one, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Disable lightbox @media’ is closed to new replies.