I get an error when creating perspective box based on mouse position 3D effect in JS

43 Views Asked by At

I am following this site and the first example.

https://armandocanals.com/posts/CSS-transform-rotating-a-3D-object-perspective-based-on-mouse-position.html

I copied the code into VSC but get an error.

Uncaught TypeError: can't access property "onmousemove", mouseOverContainer is null http://127.0.0.1:5500/mhbox.js:19

Picture of error

1

There are 1 best solutions below

0
Sean Fallon On

FACE PALM. The script tag was loading before the div element in the HTML. Just a reminder to think about when and where things load.