so i'm trying to do something oddly specific, i was asked to make a website for someone as a little gag and i'm wondering if this can be achieved with javascript/css, can you position this image so it appears above the cursor at a specific position? i want the luigi gif to appear over the goomba so it looks like its being stepped on. i've tried multiple things but anything i try breaks it. I'm a beginner in javascript! It's way harder for me than HTML and CSS.
function moveImg(event) { var x = event.clientX; var y = event.clientY; var luigi = document.getElementById("luigi"); luigi.style.left = x+'px'; luigi.style.top = y+'px'; } html { cursor: url("https://cdn.discordapp.com/attachments/975528286711078942/981315329357676585/goomber.gif"), auto; padding: 0; margin: 0; } body { background-image: url(https://cdn.discordapp.com/attachments/975528286711078942/981314082114269294/fire.gif); margin:0px; padding:0px; font-family: 'Roboto', sans-serif;\ position: relative; height: 100vh; } div { width: 100%; height: 100%; border: none; } #header { } img { position: absolute; object-position: x y; } <html> <head> <style> </style> </head> <body> <center> <img style="pointer-events:none;user-select:none;" src="https://cdn.discordapp.com/attachments/975528286711078942/981314061809647706/killhim.gif"> </center> <br> <div onmousemove="moveImg(event)"> <img id="luigi" src='https://cdn.discordapp.com/attachments/975528286711078942/981314102783799296/weegeestomp.gif'> </div> <script></script> </body> </html> An image of how it looks
