A random number generator outside of your loop - so you only get one random number over and over.
Try the following:
function randomFadeOut(i){ var random for (var e=0;e<ctnLength;e++) { random = Math.floor(Math.random() * ctnLength); $(ctn[random]).not(i).animate({ opacity : 0 }); } }
Of course, since this is a random value, the same cells can be selected more than once, which will leave several cells behind.
source share