Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Okay, solved it for sure this time.</p> <p>Turns out the problem was not in the stop() method, but with how the pulse is started. I'll try and explain this so it makes sense, and hopefully is helpful for others with similar issues.</p> <p>My mistake was assuming that when one started a pulse animation on a named element (in my case the #indicator div), then that pulse effect was simply "on", and could be simply switched off. I assumed it was binary, kind of like how a button element can be either enabled or disabled, and trying to disable it a second time wouldn't do anything.</p> <p>However, the reality is that the pulse effect is cumulative. In other words, if you call the pulse effect on the same element, it will add another pulse on top of the existing one.</p> <p>In my interface, I have a few different widgets that can turn on the indicator pulse effect. What I did not realize was happening was that under certain circumstances they were each adding a new pulse effect on top of any running ones.</p> <p>So when the stop() method was called, it probably was stopping one of running pulse effects, but others kept running, making it look as though the pulse effect was simply continuing. (It might be helpful if there was code to say "stop ALL running animations...)</p> <p>I simply added a variable storing a value that would say whether or not there was already a pulse effect going. If there was, then don't start a new one. That way, I ensure there is only one pulse effect going at any one time, and the stop() method can kill it.</p> <p>Thank you to everyone for their helpful explanations, and for taking the time to write example code that enlighted me on what I should be expecting.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload