Hi, I am using http://mess.genezys.net/jquery/jquery.async.php for loop and need to reverse the order of the array(1,2,3) instead it goes from 3 to 1
Anyway to change that from the code? Thanks
Hi, I am using http://mess.genezys.net/jquery/jquery.async.php for loop and need to reverse the order of the array(1,2,3) instead it goes from 3 to 1
Anyway to change that from the code? Thanks
Use this http://www.w3schools.com/jsref/jsref_reverse.asp reverse() function if that is what you need, maybe some code would be better explanation. cheers
var someArray = [1,2,3],
i = someArray.length - 1;
// Reverse processing
jQuery.whileAsync({
delay: 100,
bulk: 0,
test: function() { return i >= 0 },
loop: function() {
// Do something with the array
i--;
}
});
// Forward processing
i = 0;
var len = someArray.length;
jQuery.whileAsync({
delay: 100,
bulk: 0,
test: function() { return i < len; },
loop: function() {
// Do something with the array
i++;
}
});