2

I have a small JCanvas app that has the following layer def that sets a handler for mouseover. I put some console log statements in various places and it is clear that an event is generated every time the mouse moves in the rectangle, not just when it enters. mouseout also occurs with every mouse move.

That seems contrary to the definition of mouseover, common sense and the way jQuery works. Can anyone provide some insight into a problem of my making or if this is simply something I have to work around? Thanks in advance.

 $(page).drawRect( {
     click:function (layer) {topic_click(layer);},
     mouseover:function (layer) {handleMouseover(layer);},
     mouseout: function (layer) {handleMouseout (layer);},
     fillStyle:"#000044",
     x:x, y:y,
     width:300,
     height:60,
     cornerRadius:16,
     visible:true,
     name:"topic_"+ ct.toString(),
     layer:true
 });
nicolallias
  • 1,055
  • 2
  • 22
  • 51
user182170
  • 21
  • 2
  • As it turns out, what is happening is that when I do a clearCanvas() (and possibly for some other actions) a mouseout and then a mouseover are generated. The jCanvas developer is aware and will fix the problem. He also pointed out that I could handle the whole situation more effectively, so I think I will consider this solved. – user182170 Dec 26 '13 at 20:36

1 Answers1

0

Yeah, seems to be fixed: In the firebug/chrome console enter a

$("canvas").clearCanvas();
nicolallias
  • 1,055
  • 2
  • 22
  • 51