Hello! I have a diagram that I hope conveys my question:
This is a screenshot of my website that I plan on showing multiple p5.js illustrations. I want to place the drawing in the div element but I’ve not been successful so far.
Hello! I have a diagram that I hope conveys my question:
This is a screenshot of my website that I plan on showing multiple p5.js illustrations. I want to place the drawing in the div element but I’ve not been successful so far.
Just as a note, there is an option to add embed an iframe but I am reframing from using them because of how much work the browser has to do to load 50+ illustrations/iframes.
HI,
take a look to the P5.element documentation : reference | p5.js
You can attach your canvas to a parent
element. You just need to target your parent element with a document.getElementById([id])
.
So like this? If so, that didn’t work for me either. Unless I have it wrong which is definitely the case.
If you want to use select
, you need to specify the CSS type of your target. Here it is a id so select('#p1');