Forum Discussion
How to hide the cover page when publishing to WEB (for web exported content)
Okay I figured that out! Now I'm stuck on another problem.
I see the cover page flash for a second before it goes directly to the lesson. Are you experiencing the same thing? If so, how are you getting around that?
So in my scenario the flash is a feature. I use it to extend and customise the "Your Content Is Loading" preloader.
To make it completely skip without any flashes it needs to run before the page fully loads. You can do this by using the following code instead:<script type="text/javascript"> document.addEventListener("DOMContentLoaded", function() {setTimeout(function() { window.location.hash = 'lessons/rgW3y0NbhhJViEIWIiOBM-vy-2zPTaQr';}, 100); });</script>
Replace the bold section with your link. The key difference is when the code runs:
In the original:
window.onload = function() {
This waits for the the full document to load every. single. item. before it runs the code.
In the updated one:
document.addEventListener("DOMContentLoaded", function() {
This just checks that the DOM (Document Object Model) structure, which is effectively the pure code without any images, text etc. is loaded before it runs the code.
In hindsight I should have probably just put that in the post.
- NishaAtkins9 hours agoCommunity Member
Hi AriffK Thanks very much for sharing this, it's really helpful. I used the first piece of code you provided and it worked in that, it bypassed the cover page. However, as others mentioned, it did show the cover page for a split second first.
I think updated the code with the second piece of code you provided and my project just goes to the cover page (it no longer bypasses the cover page).
Please could you offer any insights as to what I might need to update? Thank you, Nisha
Related Content
- 9 months ago