javascript - How to change id of image using kineticjs -


First, let me create an image with id: image1.then I want to change the id image1 to image2 and the new image ID: image1 ... I tried but it is not working. Can anyone help me?

  var image = new Kinetic.Image ({name: data, id: "image1", x: Stage.getWidth () * 0.5-20, y: phase. GetHeight () * 0.5 -125, width: 20, height: 250, image: image, dragable: incorrect}); Image.setId ("Image2"); Var image = new Kinetic.Image ({name: data, id: "image1", x: stage.getWidth () * 0.5-200, y: stage.getHeight () * 0.5-125, width: 20, height: 250 , Image: image, dragable: incorrect}};  

  var Kk = stage.find ("# image1") [0]; kk.setId ("Image2");  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -