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?
- AriffK2 years agoCommunity Member
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.
Related Content
- 8 months ago
- 12 months ago