Answers for "javascript mousemove"

1

javascript canvas mousemove

// on brouser
var canv = document.getElementById('my_canvas');
canv.addEventListener('mousemove', e => {
    console.log({x:e.offsetX, y:e.offsetY, z:e})
});

// for mobile on touch
var canv = document.getElementById('my_canvas');
canv.addEventListener('touchmove', e => {
    ee = e.touches[0];
    console.log({x:ee.clientX, y:ee.clientY, z:e})
});
Posted by: Guest on November-12-2020

Code answers related to "javascript mousemove"

Code answers related to "Javascript"

Browse Popular Code Answers by Language