Change Cursor To Busy While Page Is Loading
I understand how to use javascript to change the cursor to busy while the page is making and ajax call. However I have a page that does not use ajax, it uses a postback to reload
Solution 1:
I am not certain if this is the best or most efficient method but if you want to change the cursor to show the page is busy after the button click the following jQuery should do the trick:
$(document).ready(function() {
$(".button").click(function() {
$("*").css("cursor", "wait");
});
});
Solution 2:
you can add a handler to the form's submit
event.
CSS
.wait, .wait * { cursor: wait; }
JavaScript
functioncursorwait(e) {
document.body.className = 'wait';
}
var fm = document.getElementById('<% =form1.ClientID %>');
var proxySubmit = fm.onsubmit;
fm.onsubmit = function () {
cursorwait();
if (proxySubmit) {
proxySubmit.call(fm);
}
}
here we're ensuring our method gets called if submit()
is called in js like the drop down does when it causes a postback. this should also catch any other instances of the form submitting.
Solution 3:
Just give each button a class, say "WaitOnClick", then just write it: $(".WaitOnClick").click(function() {
Post a Comment for "Change Cursor To Busy While Page Is Loading"