给定一个kineticjs对象的任意数组,有一种获取对象类型的方法吗?
var ary = new Array();
ary[0] = "Circle Obj";
ary[1] = "rect Obj";
ary[2] = "arc Obj";
ary[0] = "Circle Obj";
请发表评论
答案 0 :(得分:1)
是的,请使用myObject.className
ary[0]=new Kinetic.Circle({...});
console.log(ary[0].className); // returns "Circle"