Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
English
In this article, we will show you how to show a overlay with "loading..." message when user clicks on links or buttons that navigates away from current page. This serves to improve user experience as a confirmation that click has been registered and to prevent duplicate clickings.

Image Modified


Place this code in Userview Builder > Settings > Custom CSS

...

Code Block
languagejs
$(function(){
    
    $('#loadingDiv').click(function(){ $(this).hide()});
	
	//method1
    $('a, button').not("a.dropdown, button.buttonFontSize").click(function(){
        $('#loadingDiv').fadeIn();
    });
    $("form").on("submit", function(){
        $('#loadingDiv').fadeIn();
    });
});

//method2
//$(window).on('beforeunload', function() {
//    $('#loadingDiv').fadeIn	();
//});

Place this code in Userview Builder > Settings > Sub Header

...