How to change the cursor to the default value at boot

I have the following code to change the cursor when clicking a hyperlink

$('a').click(function () { $('*').css("cursor", "progress"); }); 

When the link is clicked, the cursor changes to โ€œprogressโ€ (that is, wait for the cursor) exactly as expected. However, the problem is that the cursor remains โ€œprogressโ€ after loading a new page. It changes to the default value only after moving the mouse. This is related to another issue . Others expressed the same problem.

As described in the title, I hope to change the cursor to the default value when the page loads.

+7
source share
1 answer

You havenโ€™t clearly indicated how this will be used, but here is an example of how to execute the behavior that you describe using an ajax call:

 $('a').click(function () { $('body').css('cursor', 'progress'); $.ajax({ url: "test.html", context: document.body, complete: function(){ $('body').css('cursor', 'default'); } }); } ); 
+7
source

All Articles