Okay
  Public Ticket #1129320
Adding loading overlay after clicking on any button
Closed

Comments

  •  2
    Azhar started the conversation

    How can I add loading overlay after clicking on any button till it redirects to another page?

  • [deleted] replied

    Hi Azhar,

    Here is the code for that:

    jQuery( document ).ready( function( $ ) {

    jQuery( '.my-button' ).on( 'click', function( ev ) {
    showLoadingOverlay();
    } );

    function showLoadingOverlay() {
    jQuery( 'body' ).append( '<div class="page-loading-overlay"> <div class="loader-2"></div> </div>' );
    }
    } );

    In this case, just target the elements, I have added .my-button as an example.

    I hope it will work fine for you.