In IE exists .setCapture(); .releaseCapture() functions. What's the equivalent of these functions in Firefox without using jQuery? (my client does not want to use it)
There is no such function in FF / JavaScript. The capture functions only exists in JScript.
SetCapture and ReleaseCapture are IE propriatory functions as you've discovered. There is no native way to manipulate the content menu in the same way in Firefox.
It seems like it might be possible with Gimme which can be found at http://www.codeplex.com/gimme/Wiki/Recent.aspx. There is a blog post here: http://blog.stchur.com/2007/11/21/setcapture-with-gimme/ which describes one scenario of using this to replace the functions.
setCapture() and releaseCapture() are Internet Explorer specific non-standard methods. There is no implementation in Firefox. There is a framework called Gimme that gives you some mouse capture functionality. http://www.codeplex.com/gimme/
Use event bubbling: add event listeners for the bubbling mouse events to a high-level container (possibly even document
) and use a variable to track which element should be the capturing one.
Without further information on what you're trying to do, there's not really any more to say.
As it has been said above, Firefox does not offer this functionality, and you can work around it by monitoring events on the entire document. To be sure that there is no a better trick, I’ve just checked jQuery UI, and it appears they use the same approach. So for instance if you wanted to capture mouse movements when mouse is down in jQuery, you would do:
$("#someElement").
mousedown(function() { $(document).mousemove(captureMouseMove) }).
mouseup(function() { $(document).unbind("mousemove", captureMouseMove) });
function captureMouseMove(event)
{
// ...
}