Loader after clicking the link (a)

Asked

Viewed 49 times

0

I have a wordpress site and added a plugin to turn webapp with PWA. The problem is how the address bar disappears, when the user clicks on some link it takes a while to load and the person keeps clicking because they don’t know what the page is loading.

I found a plugin that creates a Download whenever the page starts loading. However between clicking on a link and the page starting to load it takes a while.

I would like that as soon as the person clicks on some link (a) the Upload already runs.

JS code of the Loader

jQuery(window).load(function() { 

    jQuery('#wptime-plugin-preloader').delay(0).fadeOut("slow");

    setTimeout(wptime_plugin_remove_preloader, 2000);
    function wptime_plugin_remove_preloader() { 
        jQuery('#wptime-plugin-preloader').remove();
    }

});

I believe that beforeunload can help. How to include this code?

1 answer

-1

Try to decrease time in setTimeout(wptime_plugin_remove_preloader, 2000); This 2000 means 2000ms or 2 seconds. Try putting 500 ( 0.5s )

  • This 2000 means the maximum time the Loader will be active. Even if the page is not fully loaded.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.