Owow Owow -4 years ago 69
Javascript Question

jquery on mouseup on canvas doesn't work in Chrome but work in Firefox

Using Jquery 3.2.1 when trying to fire a mouseup event in Chrome 58.0.3029.110 on a canvas, it doesn't work. mouseup event work fine if i bind it on something else than a canvas.

Note : the code below works fine on Firefox (on a canvas)..

$(document).on('mouseup', '#canvas', function (e) {
console.log('fired');
});

Answer Source

well.. looks like chrome ditched "mousedown" and "mouseup" events for "pointerup" and "pointerdown"

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download