Answer the question
In order to leave comments, you need to log in
How to remove the distance between the cursor and the image when clicked?
let banknonte = banknotes[i];
banknonte.onmousedown = function(event){
banknonte.style.position = "absolute";
banknonte.style.transform = "rotate(90deg)";
banknonte.ondragstart = function(){return false;}
banknonte.style.top = event.clientY-banknonte.height/2+"px";
banknonte.style.left= event.clientX-banknonte.width/2+"px";
document.onmousemove = function(e){
banknonte.style.top = e.clientY-banknonte.height/2+"px";
banknonte.style.left= e.clientX-banknonte.width/2+"px";
}
Answer the question
In order to leave comments, you need to log in
For the #display element, remove position: relative;
Well, read about positioning https://developer.mozilla.org/en/docs/Learn/CSS/CS...
I'll just leave it here: https://developer.mozilla.org/en/docs/Web/API/HTML...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question