I have the following code to change the cursor when a hyperlink is clicked
$('a').click(function () {
$('*').css("cursor", "progress");
});
When a link is clicked, the cursor changes to "progress" (i.e. wait cursor) exactly as expected. However, the problem is that the cursor remains "progress" after a new page is loaded. It changes to default only after the mouse moves. This is related to another question. Others expressed the same problem.
As described by the title, I hope to change the cursor to default when a page is loaded.
You didn't clearly specify how it's meant to be used but here's an example of how to perform the behaviour you describe with an ajax call:
$('a').click(function () {
$('body').css('cursor', 'progress');
$.ajax({
url: "test.html",
context: document.body,
complete: function(){
$('body').css('cursor', 'default');
}
});
} );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With