0

I'm working on an online javascript canvas (not the HTML5 element, but a painting canvas). When the user starts painting, he clicks and moves the mouse from one side of the canvas to the other. This canvas is actually a table which consists of one pixel cells.

This is fine, but there's one problem. When the user moves out of the canvas while holding the mouse, Firefox thinks he tries to drag the table. It shows a no-drag cursor and 'onmousemove' isn't fired anymore, which is necessary for painting. I tried to use use CSS cursors, but the no-drag cursor 'overrides' the normal cursor. I also tried to blur (unfocus) the element. Any ideas?

bopjesvla
  • 755
  • 4
  • 15
  • 22

1 Answers1

0

In order to successfully drag out of a canvas you are going to have to use AddEventListener. There are some good tutorials of how to use AddEventListener here. Example 4 on that page is a good starting point for what you want to do.

Simon Sarris
  • 62,212
  • 13
  • 141
  • 171