473,320 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Disabling drag in Mozilla

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?

Apr 9 '07 #1
1 1296
On 9 abr, 13:25, "dominpe" <domi...@dominpe.comwrote:
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.

Apr 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Ralph Freshour | last post by:
How can I disable a button once it has been clicked? I want to prevent the user from clicking on it twice if they have a slow connection. Thanks...
15
by: Hal Robertson | last post by:
I have created a rather complicated series of html forms for a data entry wizard In my mozilla browser, every time I submit each form along the process, it asks me if I want to remember the...
9
by: Wang, Jay | last post by:
Hello, all, I would like to enable some text between <SPAN url="http://www.testserver.com/">WORD TO BE DRAGGED </SPAN>. I put some javascript and it will extract http://www.testserver.com/ from...
1
by: Ryan Stewart | last post by:
If you don't want to read this post because of its length, I understand. I've spent two and a half days on this problem and have a good deal of information to relate. And this is kind of a long...
6
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product...
0
by: R. MacDonald | last post by:
Hello, Group, I have an application that contains a large number of controls of a few different types (all custom defined). During certain specific drag-drop operations, I would like to be able...
2
by: sebastian.janoschka | last post by:
Hi, I build my first Drag & Drop with JavaScript and I would like to drag the pictures when I click on it. When I create a normal div tag with some text the script works, but when I put a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.