Animate automatically onload

Animate automatically onload

I have a page that works like a slider and I use controls to do so. What I am trying to figure out is how can I load or slide to a specific cell. I was planning on using a URL parameter to this.

Here is the code I am using for one of the controls:

$("#right").click(function(){
         $(".cellDec").css("display","none");
         $(".block").animate({"left": "-=600px"}, "300", function (){
         $("#cellCont .cell:first").appendTo("#cellCont");
         var position = block.position();
         var slideRight = position.left + 600;
         $(".block").css("left", slideRight);
         
         $(".cellDec:eq(1)").fadeIn("fast");
         
         });
         
      });


So there is a center cell that is 600px wide and one on each side that is 150px. As the next one slides into place, the last div is pulled off and moved to the front so it seems to continuously scroll.

I was trying to use loops and stuff to say if (i++ < urlParam){ do it } So i can use s=2, and the main container div (.block) would slide twice to the left, I couldn't get it working.

The controls work perfect, I was hoping to use the same on a call back. So when the div is in place it slides again until the second cell is loaded.

Tanx!!