• Resolved thomasl82

    (@thomasl82)


    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!
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @thomasl82

    Thank you very much for using our plugin. Please, edit the onclick event as follows:

    
    jQuery('.cff-processing-form').remove();
    jQuery(this.form).find('#fbuilder').append('<div class="cff-processing-form"></div>');
    setTimeout(function(){
    EVALEQUATIONS();
    jQuery('.cff-processing-form').remove();
    }, 3000);

    Best regards.

    Thread Starter thomasl82

    (@thomasl82)

    Great, this works beautiful. Thank you!

    Enjoy weekend

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘jQuery interval time delay and loading animation onclick event’ is closed to new replies.