Disabling drag in Mozilla

D

dominpe

I am trying to draw a rectangle over an image in mozilla. For that, I
use 4 divs (one for each line in rectangle) and resize and move them
to make the rectangle draw. It is working in IE6 and IE7ok, but I must
do:

document.ondrag=function(){return false;};
document.onmousedown=function(e) {return false;};

and then it works in Mozilla. The problem is that i cannot get the
focus to any text field in the page (in IE6/7 works ok).

If I comment the above code, the text fields works again, but mozilla
tries to drag the image if I press and move mouse pointer.

Any clues?
 
D

dominpe

I am trying to draw a rectangle over an image in mozilla. For that, I
use 4 divs (one for each line in rectangle) and resize and move them
to make the rectangle draw. It is working in IE6 and IE7ok, but I must
do:

document.ondrag=function(){return false;};
document.onmousedown=function(e) {return false;};

and then it works in Mozilla. The problem is that i cannot get the
focus to any text field in the page (in IE6/7 works ok).

If I comment the above code, the text fields works again, but mozilla
tries to drag the image if I press and move mouse pointer.

Any clues?

Solved thanks to job mates. I remove the above code and add "if
(evt.preventDefault) evt.preventDefault();" at the beginning of my
onmousedown callback function. It works for IE6/7 and Mozilla.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top