mercredi 31 décembre 2014

Exit jQuery loop


Vote count:

0




This jQuery code loops through rows in a table and highlights each row as it goes. I have a stop button that sets a variable to false.


I know that I can break out of the .each loop by returning false, but I want it to break out from within the queue.


How can I do this if the var is false?



$('.js-channel-notes tr').each(function(i) {

$(this).delay((i++) * 160).queue(function(){

$('.channel-row-highlight').removeClass('channel-row-highlight');
$(this).addClass('channel-row-highlight').clearQueue();

});

});


asked 1 min ago







Exit jQuery loop

Aucun commentaire:

Enregistrer un commentaire