Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing the Stage in KineticJS

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/

like image 856
Nyxynyx Avatar asked Nov 13 '22 14:11

Nyxynyx


1 Answers

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
like image 91
Ani Avatar answered Nov 15 '22 06:11

Ani