クリックして配列要素の数を記録できるかどうかを知りたいです。配列に100以上の要素があります:
var cubesmixed = [];
var cubes;
for(var i = 0; i < 143; i++) {
cubes = paper.rect(Math.floor(Math.random()*2000), Math.floor(Math.random()*2000), 0, 0);
cubes.animate({ width: 25, height: 25 }, 500, "bounce");
cubesmixed.push(cubes);
}
これらはすべて svg オブジェクトです。クリックすると、前述のように、その要素の数を取得したいと思います。
$(this).click(function() { console.log(index of current element in cubes) });
前もって感謝します!