Skip to content
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

How to terminate / destroy reveal.js -- feature request? #1145

Closed
mela-s opened this issue Feb 22, 2015 · 6 comments
Closed

How to terminate / destroy reveal.js -- feature request? #1145

mela-s opened this issue Feb 22, 2015 · 6 comments
Labels

Comments

@mela-s
Copy link

mela-s commented Feb 22, 2015

Is there a way to terminate/destroy reveal.js? I tried using Reveal.removeEventListeners() which I found on another thread, but it doesn't do what I want... I'm looking for a way to toggle reveal.js and allow the user to view it the site as a "regular" scrolling website.

Thanks.

@hakimel
Copy link
Owner

hakimel commented Feb 25, 2015

There isn't, reveal.js makes lots of changes to the DOM so it would be difficult to roll all that back. Perhaps you could work around this by reloading the page and not initializing the framework.

@Kadbury1989
Copy link

When loading Reveal video presentation in a bootstrap popup, closing the popup and re-opening the popup will mess with the video playback. When the video slide previously playing is getting played again, 2 video will start playing. Both videos are the same slide, one from DOM and one from current slide I guess. Page reload is not an option here. Also removing these previous slides do not seem to work.

@Mister-Hope
Copy link
Contributor

Mister-Hope commented Feb 20, 2022

There isn't, reveal.js makes lots of changes to the DOM so it would be difficult to roll all that back. Perhaps you could work around this by reloading the page and not initializing the framework.

Thanks for your greate work, but I bet you noticed that there are many people complaining about the hash changes when scrolling down and up when already leaving a page with reveal js.

I still VERY CONFUSED why are you guys adding a scroll event listener to root, but just leave it as is when calling reveal.removeEventListeners(). So scroll event listener IS NOT a event listener right? 👎👎👎👎👎👎👎

I fully understand that it's hard to roll back, and I understand that this feature can not be provided. And I can clean up the mess DOM myself.🙂

But without the actual listener function inside the reveal.js, it's IMPOSSIABLE for us to unregister any event listener. So at leat, PLEASE provide a way to remove all event listerners. Otherwise dumplicated listeners will be added when initialize reveal.js mutiple times, and that can be called "A memory leak". PLZ fix that.

@hakimel
Copy link
Owner

hakimel commented Feb 21, 2022

This feature has been added. You can now call Reveal.destroy() to uninitialize reveal.js which will remove all event listeners, roll back changes to the DOM and unlink all registered plugins.

@hakimel
Copy link
Owner

hakimel commented Feb 28, 2022

The new Reveal.destroy() method is available in reveal.js 4.3.0 which was released today 🚀

@hakimel
Copy link
Owner

hakimel commented Feb 28, 2022

It's already in the docs at the bottom here: https://revealjs.com/initialization/#destroy

stefanocampanella pushed a commit to stefanocampanella/reveal.js that referenced this issue Mar 1, 2022
srwohl pushed a commit to srwohl/phantom-pres that referenced this issue Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants