I need help for a changement

github logo ・1 min read

Hi guys! I would like to have an information.
https://pastebin.com/68recZYa
In this code, when I click "Move" button, the image in "myDIV" div go ahead, and the viewport follow him. But I would like that this method would work in a canvas instead of a div. Can you tell me a how can I do it?

twitter logo DISCUSS (3)
markdown guide
 

Try duplicating the code incase anything gets damaged then try doing canvas instead of div.

 

I already tryed it. The scrollbar is absent if I replace div with canvas.

 

Too bad.... Try switching code systems see what happens?

Classic DEV Post from Sep 11

Are You a Mediocre Developer? ME TOO

AndyBullet profile image

We're always making dev.to better.

Do you prefer sans serif over serif?

You can change your font preferences in the "misc" section of your settings. ❀️