Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1495729

    Hi,

    We’re using a fixed header on mobile. Also with more height because of an integrated widget. The problem is, if you jump to an anchor on mobile, the anchor and the following headline are hidden behind the fixed header.

    Is there a way to adapt the anchor links on mobile?

    I tried the solution from the thread https://kriesi.at/support/topic/anchor-links-do-not-work-properly-only-on-mobile/ with a js in functions.php. But this results in a JS error:
    Uncaught Error: Syntax error, unrecognized expression: a[href*=#]:not([href=#])

    Regards,
    Bernd

    #1495737

    Hey Bernd,

    I added the code in question on a test site, but I’m not seeing any errors after. Are you sure that you copied the whole script?

    Best regards,
    Rikard

    #1495738

    Yes, I copied the whole script. I also temporarily disabled caching and JS compression, but the error still occurs.

    Regards,
    Bernd

    • This reply was modified 1 day, 14 hours ago by Bernd.
    #1495743

    Hi,

    If you provide us with WordPress login details then we can add it for you.

    Best regards,
    Rikard

    #1495763

    Hi Rikard,

    Thanks. The script was copied in functions.php of the child theme, line 84.

    Regards,
    Bernd

    #1495779

    Hi,

    Thanks for that. I’ve added the code for you, please check your site.

    Best regards,
    Rikard

    #1495781

    Hi,

    The only difference I see, is, you moved the code from the end to the beginning of the functions.php. The error still occurs:
    Uncaught Error: Syntax error, unrecognized expression: a[href*=#]:not([href=#])

    And on mobile devices using Safari, the anchor with the H2 still disappears under the fixed header.

    Regards,
    Bernd

    #1495787

    Hi,

    Where exactly are you seeing that error?

    Best regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.