- bool –
- whether to stop the loop or not.
- If false then the loop runs infinitely.
- loopContext –
- if true then the current jQuery context starts the next loop iteration. Otherwise the original context from the .repeat() call is used for each iteration.
- Defaults to false.
Examples with boolean loop end condition
The buttons can be clicked one after the other. At the end the cycle starts over and over.
Remark that the code is the same no matter how many buttons we have.⇒
With the concatenation of two .wait()s we achieve a single short blink.
Instead of attaching an event handler explicitly we start an infinite event loop for the "click" event. Repeat loops are always sequential, i.e. the next iteration can start only if the previous one ended. You can see this behavior when double- or triple-clicking the button.⇒