Loop through stacked element continiously

Loop through stacked element continiously

I am trying to look the trough the display of a bunch of  absolutely  stacked elements, but it stops when it gets to the last one. My code looks like below: Any ideas on how I can get it to work?


  1. $(".box").each(function () {
  2. $(".box").click(function () {
  3. $(this).removeClass("retain").removeClass("back");
  4. $(this).addClass("back").delay(1000).queue(function(){
  5.     $(this).removeClass("back").dequeue().addClass("retain");
  6. });
  7. });
  8. });


See complete working code on jsFiddle.