Skip to content

Loading fullPage.js in an iframe forces scroll of parent window #4628

@alvarotrigo

Description

@alvarotrigo

Description

When loading fullPage.js inside an iframe, unless the option scrollBar: true is used, fullPage.js forces the parent window to scroll to the loaded iframe.

Link to isolated reproduction with no external CSS / JS

https://codepen.io/alvarotrigo/pen/OJYvRXv

It won't work on Codepen, but you can copy the code and run a separate page to reproduce it.
Make sure both pages run in the same domain. I suspect it only works when the iframe and the parent are both the same domain.

Steps to reproduce it

  1. Copy the content of this codepen in a page in local
  2. Make sure to have a local version of a page using fullPage.js
  3. Replace the src for the iframe with the local fulllPage.js page.
  4. Load the page
  5. It will scroll to the dynamically loaded iframe

Versions

Safari, Firefox, Chrome...
fullPage.js 4.0.21 and probably some other previous versions

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions