We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How would you put it in a parent div?
q5.createCanvas(width, height).parent( "div-id-or-element" );
returns an error of can't find parent of null
The text was updated successfully, but these errors were encountered:
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:
q5.canvas
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()
Sorry, something went wrong.
.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);
https://github.com/quinton-ashley/q5js
No branches or pull requests
How would you put it in a parent div?
returns an error of can't find parent of null
The text was updated successfully, but these errors were encountered: