How can the KineticJS Stage
be removed?
Problem: stage.removeChildren()
successfully removes its children like layers
. However stage.remove()
does not remove the stage, as shown in the jsfiddle below where console.log(stage)
after removing it still shows that the stage has not been removed!!!
The div .kineticjs-content
that was created along with a Kinetic.Stage
also remained after the .remove()
was executed.
jsfiddle: http://jsfiddle.net/jfaUg/
The stage cannot be removed as there is no remove function applicable as per the current state of KineticJS.
.remove()function that you are trying to use is applicable for children of "Container" class (documentation) and not the Container Object itself (Stage extends Container) i.e. to say
layer.remove()
works but stage.remove()
won't
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With