Javascript 将类名添加到kineticjs中的图像
我想将类名添加到图像中。对吗?谁能说出来Javascript 将类名添加到kineticjs中的图像,javascript,image,class,kineticjs,Javascript,Image,Class,Kineticjs,我想将类名添加到图像中。对吗?谁能说出来 var image = new Kinetic.Image({ name: data, id: "image"+(imageCount++), x: 10, y: 10, image: theImage, className:"group", draggable: false }); 这应该将类添加到图像中(假设“theImage”是对图像DOM元素的引用): 你能说出'theImage'变量指的
var image = new Kinetic.Image({
name: data,
id: "image"+(imageCount++),
x: 10,
y: 10,
image: theImage,
className:"group",
draggable: false
});
这应该将类添加到图像中(假设“theImage”是对图像DOM元素的引用):
你能说出'theImage'变量指的是什么吗?@rwacarter只是一个变量。我在问添加类名是否正确。为什么你需要图像的类名?样式不能与画布一起应用。
var image = new Kinetic.Image({
name: data,
id: "image"+(imageCount++),
x: 10,
y: 10,
image: theImage,
draggable: false
});
theImage.className += ' group';