Jump to content

How to have a canvas appear where I want it?

Recommended Posts

Hi,

 

I am injecting a js script using a code block. The block draws a canvas and displays stuff on it. The problem I am having is that the canvas I draw appears in a totally wrong place.

For reference, I want the canvas to appear where the red box is, but it appears all the way down close to the page's footer. What am I doing wrong?

image.png.9121fc8719ba0c9c7ea3339b80e74867.png

The html code is super simple. it goes:

 

<div>
  
<script>
// STUFF IN HERE  
</script>

</div>

 

Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

Once again I answer myself. 

The problem I was having was specific to the p5 library. Creating canvases works just fine. 

For reference, I solved the problem by creating a div in the html code and setting it as the parent of the processing canvas.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.