-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Destroy should set back the menu or fixedElement to their initial DOM position #4263
Comments
@alvarotrigo please see the reproductible example on https://codepen.io/sneko7/pen/VwWPyaZ After clicking "Destroy" the DOM outside the plugin element remains: |
Thanks for reporting it! I guess that should solve your issue? |
@alvarotrigo yes indeed, it would solve the issue 😊 |
@sneko would moving it outside of the fullpage.js wrapper be enough? |
@alvarotrigo you mean I set by default my menu outside the wrapper so it's never moved? I think in my case it would solve the issue because there would be no replication at each initialisation of the plugin, but guess someone use fixed elements into nested components for some reason, it's pretty hard for this kind of user to "move it up" in the elements tree. But indeed if I'm the only one facing this kind of issue, I guess I'm fine with that (and no need to rework a piece of the logic for fixed elements) 👍 |
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 afixedElements
) 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()
anddestroy('all')
The text was updated successfully, but these errors were encountered: