Can't Create Ring That Moves With Mouse For Computer Game? Pleease Help?

Hi All,

Please help?

Best regards,

Yanni

ddEventListener("■■■■■■■■■■■■■■■■■■■■■■■■■■) How do I add the extension animationiteration? When I type in addEventListern animationiteration doesn’t come up on the list that opens? I am trying to create a ring that moves over the game with the mouse.

var hole = document.getElementById(“hole”);
var game = document.getElementById(“game”);
var score = 0;

hole.addEventListener(“animationiteration”, RanHole)

function RanHole(){
var random =-((Math.random()*350)+150)
hole.style.top = random+“px”;
}

Thank You for your response!

I tried the code below and it still doesn’t work. What JavaScript code can I use to make a ring(site) that moves over a computer game with a mouse?

var hole = document.getElementById(“hole”);
var game = document.getElementById(“game”);
var score = 0;

function RanHole(){
var random =-((Math.random()*350)+150)
hole.style.top = random+“px”;

hole.addEventListener("animationiteration", RanHole) 

}

You may want to do some kind of drag-and-drop stuff.
Here’s a link that explains some stuff about it: Drag'n'Drop with mouse events
and another one: Create a Draggable Element in JavaScript | KIRUPA
and another: An Essential Guide to JavaScript Drag and Drop By Examples

Thank You for the information but what JavaScript code do I need to make a gun site(ring) on the computer game that moves with the mouse? The code below I use to try and do it doesnt’work. Visual studio doesn’t recognize animationiteration in the code. What should I use instead of animationiteration to make a gunsite on the computer game?

When I type animationiteration a list does not pop up? What extension do I need to add in Visual Studio for a list to pop up?
What JavaScript code do I need to make a gun site(ring) on the screen that moves with the mouse?
var hole = document.getElementById(“hole”);
var game = document.getElementById(“game”);
hole.addEventListener(“animationiteration”, RanHole)
function RanHole(){
var random =-((Math.random()*350)+150)
hole.style.top = random+“px”;
}

JavaScript Full Course 2022 | JavaScript Tutorial For Beginners | JavaScript Course | Simplilearn - YouTube Please watch from 8 hours 35 minutes on this video to see what I am trying to do? Pleeese help?

The yellow ring is not part of the webpage nor the JavaScript being programmed as shown in the video. It is part of the video.

Thank You for your help