javascript - Creating variable in kineticjs -
, after leaving the image in the container, each image is stored in the variable called the image. I want to store every left image stored in different variable names. This is not working (image1.onload). how can I do this?
if ($ (ui.helper) .hasClass ("sticky")) {console log (); Var image = new Kinetic.Image ({name: data, id: "image" + (imageCount ++), x: $ stageContainer.width () / 2 - ($ (ui.helper) .wide () / 2) , Y: $ StageContainer.height () / 2 - ($ (ui.helper). Light () / 2), image: image, dragable: wrong}};} Else {var image1 = new kinetic image ( {Name: id: "image" + (image ++), x: x, y: $ stageContainer.height () / 2 - ($ (ui.helper) .hite () / 2), image: image , Draggable: true}}}}
I think the use of an array The way to do may be.
var images = []; Images.push (new kinetic image ({name: data, id: " V "+ (image ++), x: x, y: $ stageContainer.height () / 2 - ($ (ui.helper) .ight () / 2), image: image, dragable: true}) ) You can reference them in the array with your index, like images [0] .onload
Comments
Post a Comment