Open neelr opened 3 years ago
Hi @neelr ,
Currently you can use q5.canvas
to get the canvas HTML element, and put it under new parent using the usual JS way:
let parent = document.getElementById("div-id");
parent.appendChild(q5.canvas);
But I do think the .parent()
wrapper is nice, so I'm considering adding the feature soon. Thanks for reporting!
.parent()
is definitely a useful thing!
I won't implement .parent()
because technically its bad practice because it causes a CLS https://web.dev/cls/
But I did implement adding the parent element as a parameter to the instance constructor!
let q = Q5(parentElem);
How would you put it in a parent div?
returns an error of can't find parent of null