我想为图片添加课程名称。这是对的吗?谁能说出来?
var image = new Kinetic.Image({
name: data,
id: "image"+(imageCount++),
x: 10,
y: 10,
image: theImage,
className:"group",
draggable: false
});
答案 0 :(得分:0)
这应该将类添加到图像中(假设' theImage'是对图像DOM元素的引用):
var image = new Kinetic.Image({
name: data,
id: "image"+(imageCount++),
x: 10,
y: 10,
image: theImage,
draggable: false
});
theImage.className += ' group';