Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将类名添加到kineticjs中的图像_Javascript_Image_Class_Kineticjs - Fatal编程技术网

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';