Skip to content

Destroy should set back the menu or fixedElement to their initial DOM position #4263

Open
@sneko

Description

@sneko

Description

Hi,

I have multiple pages using fullPage.js on a Single Page Application, so when I leave a page I destroy the fullPage.js instance and I init a new fullPage.js instance on the new page. This works great... but:

The menu I specified into your plugin (it could have been a fixedElements) seems to be put outside the fullPage element by your plugin, and set just under the body in the DOM tree. My issue with that is when I delete the instance, this element remains. So after I navigate to another page, the menu will be recreated over and over... stacking them up.

It's a memory leak issue (guessing a user would switch pages the website for too long), but also, that's the older menu that is over all others, so since I change menu style depending on the current page, I won't see changes.

I hope I'm clear enough 😄 , maybe I'm doing something wrong?

Thank you,

@alvarotrigo

EDIT:
Note that I tried both destroy() and destroy('all')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions