var _s = $('#rect0');
function run(){
_s
.show('slow')
.animate({left:'+=200'},2000)
.queue(
function(){
$(this).toggleClass('red');
$.dequeue(this);
}
)
.animate({left:'-=200'},2000)
.hide('slow',run);
}
run();
jQuery.dequeue( queueName:string )
キューの先頭から処理を取り出し実行する。