I have about 72 divisions of class="box"
these are some black colored boxes covering my whole pages, and i want to remove these divisions one by one and randomly after the completion of on of my function.
Here is what i am doing to remove these boxes randomly,
function removeBoxes(){
var erase;
//var to store the length of array of divisions
var total = $(".box").length;
while(total > 0)
{
//generating a random number
erase = Math.floor(Math.random() * total);
$(".box").eq(erase).fadeOut(10000, function(){
$(this).remove();
});
total = $(".box").length;
}
}
Later i would also add some time delay between two removals, but for now i just want to know how to remove these boxes one by one.