jQuery interval time delay and loading animation onclick event

[ad_1]

Hello there,

Because the cff-calculation happens to quick I try to achieve delay of few seconds after pressing the (calculation) button as an onclick event. I tried it with this html and jquery code from this forum and it works:

<div class="delay"></div>

my_delay = 0;

my_interval = setInterval(function(){

    jQuery('.delay').html(my_delay);

    my_delay = my_delay - 1;

    if(my_delay<0){

        clearInterval(my_interval);

        jQuery('.delay').html('');

        EVALEQUATIONS();

    }

}, 3000);

However, during this delay (on click event) I try to achieve parallel to display a loading spinner or, if possible, to use the “display loading form animation” from cff to show/animate the user that loading is in progress. Is there a way?

Thank you guys and keep up all the good work!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer