I have been struggling to figure out what I am doing wrong here. I am simply trying to change the cursor to "progress" using jQuery's .css()
function after the user clicks a button but before looping through a series in HighStock (that takes a couple of seconds to execute) and showing/hiding some lines (32 of them!).
I have tried many things but no matter what I try it simply freezes the button in the "down" position (not changing the cursor, but you can still move it) until the code is finished.
Here's what I've tried (in order):
Note: All of my attempts produce the exact same results (i.e., no errors are produced, the code gets executed, but I never get the "progress" cursor to show while code is busy being executed.
$("#onAllOverall").click(function () {
$("body").css("cursor", "progress");
for (var s = 0; s < series.length; s++) {
series[s].hide();
}
$("body").css("cursor", "default");
});
So then, I tried:
$("#onAllOverall").click(function () {
$("body").css("cursor", "progress");
}
$("#onAllOverall").click(function () {
for (var s = 0; s < series.length; s++) {
series[s].hide();
}
$("body").css("cursor", "default");
});
I even went so far as to try:
function progressCursor() {
$("body").css("cursor", "progress");
}
$("#onAllOverall").click(function () {
$.when(progressCursor).done(function () { //also tried $.when.then(), but I admit I don't know much about these methods;
for (var s = 0; s < series.length; s++) {
series[s].show();
}
});
$("body").css("cursor", "default");
});
I remember trying a couple of other things but I can't rightly remember what they were, but they were basic and unhelpful.
I feel kind of silly that nothing is working here. What am I doing wrong?