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?
This 2000 means the maximum time the Loader will be active. Even if the page is not fully loaded.
– Mauricio Santos