473,400 Members | 2,145 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,400 software developers and data experts.

onDrag handler in FireFox?

Hi,

I am trying to handle my mouse movements myself in my JavaScript
application which is ok except for the following problem.

If I happen to click on an image and then move the mouse, the "no-drop"
icon appears as the browser is starting to drage the image url
somewhere. When this happens, I no longer recieve any mouse events in
my JS app. This can be prevented in IE by adding an event handler for
the onDrag event that simply returns false. This prevents IE from
continuing to try and drag the image and instead it continues to send
mouse events.

However, I cannot find a way to do this in Firefox. Can anyone help?

Cheers,

Tom...

Oct 20 '05 #1
2 6702


tf******@gmail.com wrote:
This can be prevented in IE by adding an event handler for
the onDrag event that simply returns false. This prevents IE from
continuing to try and drag the image and instead it continues to send
mouse events.

However, I cannot find a way to do this in Firefox.


<img onmousedown="if (event.preventDefault) {
event.preventDefault();
}"

--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 20 '05 #2

Martin Honnen wrote:

<img onmousedown="if (event.preventDefault) {
event.preventDefault();
}"


Perfik! Thanks Martin.

Oct 21 '05 #3

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

Similar topics

10
by: David | last post by:
Is there something that I can use to prevent the a user from dragging something, an image for instance. In IE I can use the ondrag = "return false;", is there a way to achieve the same way with...
1
by: cjl | last post by:
Hey all: I'm trying to write a cross-browser (IE and firefox) event handler for the mousewheel. Basically my web app is an image viewer, so if you scroll "down" with the wheel the next image...
6
by: Tom | last post by:
Hi, In the following code I have reproduced a problem in IE that is extremely annoying for my application. <html> <head> <script type="text/javascript">
3
by: jeff29_b | last post by:
I am having a strange problem on a web form. I have an image button with an OnClick event handler. When I click the image the event isn't being called in the code behind when browsing in firefox....
6
by: Giggle Girl | last post by:
Hi there! I am trying to get a web app for our intranet (IE 6+ only) to have a similar behavior to MS Excel, where you can "drag" in between Column Headers to resize them. See an online demo...
2
by: petermichaux | last post by:
Hi, I thought it is about time I tried writing some JavaScript with XMLHttpRequest instead of just using the Yahoo! UI library. The simple page below works in both Safari and Opera but I don't...
5
by: Herkum | last post by:
I created this generic AJAX Handler to work with Firefox and IE. However, it seems that somewhere in updating Firefox to 2.0.0.9 that the handler assigned to onreadystatechange is no longer getting...
2
by: wolverine | last post by:
Hi All, In Mozilla Firefox, to onblur and onfocus event of each and every html element, the browser itself will attach a native event handler. I mean if you type,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.