I do not use jQuery myself, but what about this:
var intervalMilliseconds = X; // set to your value for X var divFoos = $("div.foo").get(); var intervalId = setInterval(function() { $(divFoos.splice(Math.floor(Math.random() * divFoos.length), 1)).show(); if(divFoos.length == 0) clearInterval(intervalId); }, intervalMilliseconds);
That should do the trick.
UPDATE: since your description is not explicit, I assumed that you mean that in the end you want to show all of them, and that when they are visible, we are done. If not, explain in more detail so that I can update this (if you can no longer determine what you need from the code that I provided).
source share