Streaming live at 10am (PST)

Linking source image via webflow server not working


I am trying to set up a canvas in my page that draws an image when the mouse moves (see example tutorial here:

When I host the image locally I can make it work using this HTML & JS:

<canvas id="myCanvas" width="200" height="100"></canvas>

const canvasTag = document.getElementById("myCanvas");

canvasTag.width = window.innerWidth * 2
canvasTag.height = window.innerHeight * 2 = window.innerWidth + 'px' = window.innerHeight + 'px'

const context = canvasTag.getContext('2d')
context.scale(2, 2)

const image = document.createElement('img')
image.src = ''
document.addEventListener('mousemove', function(event) {
  if (image.complete) {
    context.drawImage(image, event.pageX, event.pageY, 400, 600)

But when I try to put it into Webflow (via an HTML embed in the page), using the image.src as the link generated from the image in my Webflow assets, it doesn’t work.

Is there a way to fix this?

I am happy to pay for someone’s time to make this work and explain it to me!

Thank you!!

Here is my site Read-Only:

I would be happy to pay anyone who can help me get this working as it’s for a client. Thank you!

Hey Rose,

I’ll try and take a look tomorrow if i get a chance, and if no one else steps in first.

No need to pay anything, looks like a cool concept.

1 Like

@rrrosegregoryyy - Your closing script tag is not valid. It should be </script>. Fix this in your code and your canvas will render.

1 Like

Thank you Jeff!!!

What a life-saver!