I have elements in page:
<a class="element" onclick="do this"></a>
<a class="element" onclick="do this"></a>
<a class="element" onclick="do this"></a>
<a class="element" onclick="do this"></a>
i need to trigger the click on each one and delay some time between the triggered clicks.
//for each one .element
$('.element').delay(800).trigger('click');
then i need to repeat this cycle as infite cycle, BUT i need to stop it when user click on a .element
i tryed many things like $.each( loop trigger); but i can’t understand how to cycle all to infinite and stop it when i sad 🙁
There might exist more elegant solution, but here are my two cents:
jsFiddle