Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1427608

    Hi, I have the problem that the headline of my website is often not displayed completely if the cookies are not accepted. Sometimes only half of it is visible, but not on all devices. I have already noticed this on a Windows laptop in Google Chrome and on a Mac Book Pro in Safari. Unfortunately, I have never been able to reproduce the problem myself, but I would like to fix it. Do you know what the problem could be? Please find attached the access data to my website.

    #1427609

    Addendum: I have now been able to reproduce the problem, it occurs when the website is initially smaller than 390px and is then enlarged. At the beginning everything still fits, but when you enlarge it, half of the text disappears. I use LayerSlider here.

    So the problem only occurs, when you resize the browser – window.

    • This reply was modified 11 months, 2 weeks ago by mpraeauer.
    #1427631

    Hi,
    This sounds like when you are testing you are trying to emulate different screen sizes by resizing the browser widow without reloading the page. Often javascript needs to be reloaded for the screen size calculation to work correctly. PHP can’t determine the users screensize so javascript is used and it doesn’t work on the fly like CSS.
    Typically this doesn’t cause any errors in a real life situation because real devices don’t change from smaller than 390px to a desktop size suddenly, so the correct way to test is to reload the page when you change the size dramatically and you know the element is using javascript like the LayerSlider.
    Developers will sometimes add a javascript Event Listener for the resize event, but typically this is viewed as unnecessary and adds overhead to the page.
    So I recommend reloading the page when you test, but if you really want to change this you could add this script to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_reload_script() { ?>
      <script>
    var resizeId;
    window.addEventListener('resize', function() {
        clearTimeout(resizeId);
        resizeId = setTimeout(doneResizing, 500);
    });
    
    function doneResizing(){
        location.reload();
    }
    </script>
      <?php
    }
    add_action( 'wp_footer', 'custom_reload_script', 99 );

    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.

    Best regards,
    Mike

    #1427708

    Thanks for your fast response!

    #1427712

    Hi,
    Glad we were able to help, 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 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Headline isn’t shown correctly if cookies aren’t accepted’ is closed to new replies.