Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1377213

    Hi,

    is it possible to disable all links to the lightbox for a certain screen width (mobile)?

    Thank you.

    Best regards
    Vera

    #1377215

    Hey 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!
    Yigit

    #1377472

    Hi,

    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,
    Vera

    #1377554

    Hi,

    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,
    Ismael

    #1378013

    Hi Ismael,

    thank you for your update.
    I’m using an iPhone SE 2. generation. How do you calculate that?

    Best regards,
    Vera

    #1378083

    Hi,

    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,
    Ismael

    #1378144

    Hi 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,
    Vera

    #1378201

    Hi,

    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,
    Ismael

    #1378542

    Hi 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,
    Vera

    #1393867

    Hi,

    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,
    Ismael

    #1393956

    Hi 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,
    Vera

    #1394494

    Hi,

    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,
    Ismael

    #1394696

    Hi 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,
    Vera

    #1394734

    Hi,

    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,
    Ismael

    #1396527

    Hi 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,
    Vera

    #1396687

    Hi,
    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

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Disable lightbox @media’ is closed to new replies.