// queue管理するための要素 var q = $('<div>'); function writeQ(){ $('#log').text( q.queue().length ); } function anim(){ var $hoge = $('<div>').css({ position: 'absolute', left: Math.random()*400|0 + 'px', top: Math.random()*400|0 + 'px', width: 10+Math.random()*40|0 + 'px', height: 10+Math.random()*40|0 + 'px', backgroundColor: "#" + Math.random().toString(16).slice(2,8) }).appendTo($('body')); var props