Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > onDrag handler in FireFox?

Reply
Thread Tools

onDrag handler in FireFox?

 
 
tfrancis@gmail.com
Guest
Posts: n/a
 
      10-20-2005
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...

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      10-20-2005


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/
 
Reply With Quote
 
 
 
 
tfrancis@gmail.com
Guest
Posts: n/a
 
      10-21-2005

Martin Honnen wrote:
>
> <img onmousedown="if (event.preventDefault) {
> event.preventDefault();
> }"


Perfik! Thanks Martin.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
funny (not haha) ondrag/onmousedown behavior Giggle Girl Javascript 6 05-10-2006 03:57 PM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Multiple onmouseout events in IE when returning false to the onDrag event. Tom Javascript 6 10-27-2005 04:01 AM
ondrag event equivalent for mozilla David Javascript 10 08-16-2005 03:10 AM
OnDrag mouse icon Roberto Messora Javascript 0 12-04-2003 01:56 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57