How to move the image with the mouse? onmousedown and onmousemove the right events?
<html> <body> <script type="text/javascript"> funcion good() { document.getElementById("omna"); document.getElementById("omna).style.position="absolute"; document.getElementById("omna").style.top=somevalue; 'these keeps changing document.getElementById("omna").style.left=somevalue; ' these keeps changing } </script> <img id="omna" src"/something.jpg" onmousedown="highlight() onmousemove="good()" onmousedown="stop()"> 'not working </body> </html>
How to use mousedown event on image? and with the mousedown event (I mean mousedown in the image), it should constantly run the mousemove event mousemove in JavaScript, and when mouseup even occurs, it should stop. How do I go through the mousemove event mousemove ? unable to figure it out. I found some solutions on google but couldnโt understand the syntax and thatโs it. If one way or another you publish the same, explain your decision to me.
Sorry, forgot to say that my mousedown and mousevents not working. Some people suggest using an anchor tag to make it good? and why do mouseevents work for an image?
source share