1

I am trying to do something like the following in my Firefox plugin - I open a sidebar on which I show certain UI elements (like an image) and allow people to drag and drop those images from the sidebar onto the document. I am trying to achieve my goal by doing this:

var currentWindow = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser");
var grabWin = currentWindow.getBrowser().contentWindow;
var mainDoc = currentWindow.getBrowser().contentDocument;

$(mainDoc).bind('mousemove', mouseMove); // I am using jquery here

Now mouseMove is a function I've written in my firefox plugin's code. However, I notice that if I mousedown on the image in the sidebar and then move the mouse (essentially drag) then the mouseMove() is not being called.

Is there any way that I can capture this event on the document's mouse-move?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Kapil
  • 572
  • 1
  • 5
  • 23

0 Answers0