I've just been through this. preventDefault() in mousedown will keep
Firefox from selecting text as you drag.
This mousemove crap is the only place in my code where I check the
browser. I'm sure it depends on the functionality you're trying to
block, but for me it worked something like this (code edited down a
bit):
$("#actionSurface").mousedown(function(e) {
visHomeX=e.pageX;
visHomeY=e.pageY;
if (!$.browser.msie) {
e.preventDefault(); //firefox's
}
$("#actionSurface").mousemove(function(e) {
if ($.browser.msie) {
//stuff you wanted to do during mousemove for ie here
e.preventDefault(); //IE's
return false;
}
//stuff you wanted to do during mousemove for firefox here
return true;
});
Hope I didn't botch it trying to make it clear.
I noticed that in your code, you check for mousdown in mousemove. I
got rid of that by adding the handler on mousedown and getting rid of
it on mouseup.
--TT
On Feb 19, 7:43 pm, jquertil <[EMAIL PROTECTED]> wrote:
> does anyone know why the preventDefault() would work fine in IE but
> not in Firefox? I tired placing it elsewhere and putting it in
> multiple plaves - no luck...
>
> Thanks for any pointers!
>
> isMouseDown = false;
> $('#dragger').mousedown(function(e){
> isMouseDown = true;
> $(document).mousemove(function(e){
> e.preventDefault(); // this bit for some reason is not
> taken
> seriously by Firefox
> if(isMouseDown == true){
> // move things...
> }
> });}).mouseup(function(e){
>
> isMouseDown = false;
>
> });