• I’m using the Page Scroll to ID plugin on a WordPress site in Avada and have an issue where anchor scrolling on page load gets overridden by an embedded iframe.

    Setup:

    • Multiple anchor sections on the page set with standard id attributes via the theme.
    • The page includes an embedded booking widget loaded via a script that inserts an iframe.
    • Anchor links use the standard format, for example:
      mysite.com/page/#section-anchor
    • Plugin settings:
      • Page load scrolling enabled
      • “Prevent other scripts from handling plugin’s links” enabled
      • Default link selector used

    Problem:

    When visiting a URL with an anchor, the page initially scrolls to the correct section. However, once the iframe finishes loading, it causes the page to scroll back up, overriding the intended scroll position.

    This issue occurs for anchors located below or near the iframe. What’s even more frustrating is that it works in the first instance but not if you try again – as in it’s unpredictable

    What I’ve tried:

    • Adjusting scroll offset
    • Disabling other plugins and scripts
    • Using [ps2id] shortcodes
    • Custom JavaScript to delay or repeat the scroll
    • Observing the iframe load with MutationObserver
    • Clearing all caches

    None of these reliably fix the problem. The iframe appears to shift layout or trigger scroll behavior late in the load process.

    Question:

    Is there a way for Page Scroll to ID to reapply or delay the scroll until after all layout shifts (including iframe loading) are complete? Or is there a recommended method to handle deep linking anchors on pages with embedded iframes?

    I would appreciate any guidance.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author malihu

    (@malihu)

    @groggy72 Hello! Sorry for the late reply but I was away for summer and it seems I missed your request.

    Try this:
    Go to plugin settings and enable “Verify target position and readjust scrolling (if necessary), after scrolling animation is complete” and/or (optionally) “Extend target position verification and scrolling adjustment for lazy-load scripts (images, iframes etc.) and changes in document’s length” option.

    Save changes, test and let me know 🙂

Viewing 1 replies (of 1 total)

The topic ‘iframes hijacking anchor links’ is closed to new replies.