473,378 Members | 1,479 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,378 software developers and data experts.

how to disable don't want to drag n drop

Hey,

I am writing a web app to allow users to draw over an image. The workflow of drawing a rectangle is:
1. click a mouse button
2. hold and drag
3. while the mouse moving, the size of a rectange will change.
4. once a mouse button is released, the rectangle stays.

I am having a problem with #2. In firefox, every time i tried to hold a mouse button and drag, firefox seemed thinking i was trying to drag the image underneath and turned the cursor to "STOP". And I lost the mouse down event.

any idea? thanks
May 26 '08 #1
4 1677
acoder
16,027 Expert Mod 8TB
You need to stop the propagation of events using the stopPropagation() method (W3C) or cancelBubble = false (Microsoft). See this link.
May 26 '08 #2
thanks for reply, acorder.

I am not sure it involves event bubble or propagation, because all mouse events are tied to the image. I did use in IE setCapture/releaseCapture to redirect all event firing to the same set of handlers. So the code works fine in IE.

You need to stop the propagation of events using the stopPropagation() method (W3C) or cancelBubble = false (Microsoft). See this link.
May 26 '08 #3
hsriat
1,654 Expert 1GB
If you are doing it like this:
onmousedown="drawOverImage();"

Add return false, like this
onmousemove="drawOverImage();return false;"

where drawOverImage() is the function you have made.
May 26 '08 #4
acoder
16,027 Expert Mod 8TB
If that doesn't work, post your code.
May 26 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: SamSpade | last post by:
There seems to be two ways to put things on the clipboard ( I don't mean different formats): SetClipboardData and OleSetClipboard If I want to get data off the clipboard do I care how it was put...
3
by: Ajay Krishnan Thampi | last post by:
I have a slight problem implementing 'drag and drop' from a datagrid to a tree-view. I have pasted my code below. Someone please advice me on what to do...pretty blur right now. ==code== ...
1
by: Robin Tucker | last post by:
Apologies for the ambiguous title, you will be expecting me to be asking how to perform drag and drop from my application into another application. Well, kind-of. I've got drag and drop sorted,...
2
by: khng | last post by:
How to disable the copy/drag event for some selected textfield as I want the user to key in instead of copy or drag the required information. For IE, I done it with the onPaste and onDragEnter...
9
by: surf_doggie | last post by:
Im not sure if this is the group to post in, if anyone knows a more appropriate one please let me know. Please consider the following example of a feature most all browsers have that I would...
4
by: Vincent | last post by:
I have created a drag and drop scheduler within Microsoft access. One of our bug testers was doing some testing and noticed that the drag and drop gets messed up if they press both the left and...
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
18
by: mclerp | last post by:
I want to disable copying picture files from an HTML file. I have purchased "Activ eBook Compiler" software which disables left-click copying, printing, and Alt+PrtScr copying to clipboard but it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.