var items = ["1","2","3","4","5","6","7","8","9","10","11","12"];
function bigger(){
for(var i=0;i<items.length;i++){
a = [Math.floor(Math.random() * items.length)+1];
scale(a);
}
}
function scale(number){
$("#inner"+number+"").delay(100).transition({scale:1},300);
items.splice(number,1);
}
bigger();
here is my code ı try to delete numbers and use until finish array and i want to do it 1 by 1
for
loop withwhile(items.length > 0)
, or your loop will stop before the array is empty. Remove the[]
froma = [Math...
- You're creating an array with one element and passing that array toscale()
. – nnnnnn Jun 4 at 11:47delay()
only applies a delay to the animation queue on the individual element, so all of your elements will be processed at once. – nnnnnn Jun 4 at 11:53