var pannel = $(“#pannel”);
var thePannelSize = {
width: pannel.width(),
height: pannel.height()
};
var pannelMatrix = initMatrix(thePannelSize.width / baseWidth, thePannelSize.height / baseHeight);
//得到要排序的不规则宽高的方块队列
var sortQuene = getQuene(pannel.find(“div”), base);
//遍历matrix
var theQu = sortEveryEle(pannelMatrix, sortQuene, base);
var theQuOne = theQu.shift();
var selfCall = function(){
if (!theQuOne) {
return;
}
var my = arguments.callee;
theQuOne.rect.ele.show().animate({
left: “+” + theQuOne.left,
top: “+” + theQuOne.top
}, {
duration: 1000,
easing: “easeOutBounce”,
complete: function(){
theQuOne = theQu.shift();
my.call();
}
});
}
selfCall();
</script>
</body>
</html>










