Ok here is my code
$("#content_Div").ajaxStart(function () { $(this).css('cursor', 'wait') }).ajaxComplete(function () { $(this).css('cursor', 'default') });
This is a fairly simple problem: on ajaxStart, the cursor immediately changes to (wait) hourglass, but on ajaxComplete it does not go back to defalut until you move the mouse.
lol this was my problem, but while I was writing this, I realized that after ajaxComplete, if you click, it will change to the default value, so the only reason the cursor changes immediately to ajaxStart is that you need to double click an element in content_Div to start the request, so the click event is a cursor change after the start of the ajaxStart event. so I want to change the cursor without moving it or clicking again.
Obviously, I want to use the cursor to inform the user when the request is complete.
early
for Thomas:
function DF() { //Deletes selected File if (selectedfiles.length == 0) { alert("No file slected!"); return }; var selectedtxt = (selectedfiles.length == 1) ? "'" + basename(selectedfiles[0]) + "'?" : 'these ' + selectedfiles.length + ' files?'; if (confirm("Are you sure you want to delete " + selectedtxt)) { $.each(selectedfiles, function () { $.post("server/editfile.php", { user: user, oper: "del", path: "../" + this }, function (res) { if (res) { alert(res); } else LT(dirHistory[current]); }); }) }
}
jquery html css mouseevent
dlaurent86
source share