+ 5
What is JavaScript's equivalent for the Onmousedrag event?
2 odpowiedzi
+ 2
I just figured it out!
--CODE--
var mouseisdown=false;
function mouseup(){
mouseisdown=false;
}
function mousedown(){
mouseisdown=true;
}
function drag(){
if(mouseisdown){
//code here
}
}
window.addEventListener("mouseup",mouseup)
window.addEventListener("mousedown",mousedown)
window.addEventListener("mousemove",drag)
0
ondrag? What are you trying to achieve?
HTH and good luck!