How to 'delay' website loading and show animated gif / loading bar?

After people submit a quiz (3rd party), they are redirected to a Divhunt Page showing the results. Is there a way to delay the website loading and show a message with gif “analyzing your data” to simulate that the data is being analyzed? And after like 4 seconds the results (i.e. the website) will show?

I would suggest you to use the Custom code.

1st prepare the Component block with Absolute 9999 0 / 0 / 0 / 0 values to be a cover of your site
2nd insert the images etc to that component and style it your needs
3rd use this custom code js (create the code in code blocks like loader.js or something)
4th add id to the Component block “loading-component”

document.addEventListener("DOMContentLoaded", function () {
    // Get a reference to the loading component div
    var loadingComponent = document.getElementById("loading-component");

    // Show the loading component = "block";

    // Hide it after 4 seconds (4000 milliseconds)
    setTimeout(function () { = "none";
    }, 4000);
1 Like

Thanks for your suggestion @petrbilek . Questions:

  1. With “components”, you mean creating a real component and not just a container. Correct?


  1. Where to put the absolute values “9999 0 / 0 / 0 / 0”? Is it “Position” “Absolute”? If yes, is 9999 supposed to be the top number?


  1. How to get the ID of the component? Or is ID = Name of Component?

Many thanks for clarifying,

Another option is to create a new page with an animation. Then I don’t need components etc. After 3 seconds, it can automatically redirect to a new URL.

Do you think this would be simpler?

  1. layers set-up

  2. Add the ID Layer > Settings > ID

  3. Add it to the component to simply re-use

  4. Add the code

I have simplified the code:

  // Function to hide the element
        function hideElement() {
            var element = document.getElementById("loading-component");
   = "none";

        // Set a timeout to call the hideElement function after 4 seconds (4000 milliseconds)
        setTimeout(hideElement, 4000);

By using this, you will have a component which you can style how ever you need and re-use on all pages needed. Just add the component on each of the page :slight_smile:

1 Like

Thanks!! Could I also just make a new page (and make it as component) and have an automatic redirect after 3 seconds? Just pushing the user to the final URL. Might seem simpler?

Not sure what exactly you would love to achieve?

Well, I want the user to get the feeling that we are “processing” his data before showing him the results. Basically, the user is providing us with some data on Jotform Quiz (similar to Typeform). Then, when he clicks “show me my results,” he gets redirected to my homepage. Instead of immediately displaying the results, I believe it would enhance the experience to introduce a slight delay to simulate the data processing required to obtain the results.
Google provided me with this script for an automatic redirect after 5 seconds. I will test it tomorrow. If you have a better option or notice any mistakes, please let me know.

function Redirect() 
    setTimeout('Redirect()', 5000); 

I followed your guidance making a component and hiding it with JS, works well! Thank you, @petrbilek !

1 Like

Supa awesome! Glad it works :slight_smile:

1 Like