473,692 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detecting onmouseup outside browser window?

If I perform a mousedown within a document, move the mouse outside the
browser window, and then release the mouse button, the document.onmous eup
event does not fire. Is there any way to detect a mouseup event outside the
document?

Also, how can I get the relative coordinates of the cursor while it is
outside the browser?

Thank you.
Jul 23 '05 #1
20 7918
Mandy Memphis wrote:
If I perform a mousedown within a document, move the mouse outside the
browser window, and then release the mouse button, the document.onmous eup
event does not fire. Is there any way to detect a mouseup event outside the
document?
No.
Also, how can I get the relative coordinates of the cursor while it is
outside the browser?


You can't.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 23 '05 #2
"Randy Webb" <hi************ @aol.com> wrote in message
news:8Y******** ************@co mcast.com...
Mandy Memphis wrote:
If I perform a mousedown within a document, move the mouse outside the
browser window, and then release the mouse button, the document.onmous eup event does not fire. Is there any way to detect a mouseup event outside the document?


No.
Also, how can I get the relative coordinates of the cursor while it is
outside the browser?


You can't.


Hi Randy,

Walter Zorn has managed it. See here:

http://www.walterzorn.com/dragdrop/dragdrop_e.htm

I just wish his code wasn't so cryptic!
Jul 23 '05 #3
On Mon, 5 Jul 2004 13:15:03 -0400, Mandy Memphis wrote:
"Randy Webb" <hi************ @aol.com> wrote in message
Mandy Memphis wrote:
If I perform a mousedown within a document, move the mouse outside the
browser window, and then release the mouse button, the document.onmous eup event does not fire. Is there any way to detect a mouseup event outside the document?
No.
Also, how can I get the relative coordinates of the cursor while it is
outside the browser?


You can't.

... Walter Zorn has managed it. See here:

http://www.walterzorn.com/dragdrop/dragdrop_e.htm


You assertion does not seem to be borne out
by the way the code acts.

E.G. If you make your browser window 'little' and
put it in the middle of the screen, you can drag
the mouse out of the window on the right, the image
will keep scrolling (too the right). While the image
keeps scrolling (within the web page), you can move
the mouse pointer around the outside of the window,
when you enter it on the left, the script seems to
recognize *that* and the image which was still scrolling
right now jumps to the left of the screen.

That behaviour supports what Randy was saying,
the script is not aware of the co-ords of the
mouse when it is beyond the window.

It is a security thing AFAIU, you do not want some
script from a web-page able to monitor what you
do beyond the browser, that could allow all sorts
of nasty snooping.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #4
Andrew Thompson wrote:
Walter Zorn has managed it. See here:
http://www.walterzorn.com/dragdrop/dragdrop_e.htm You assertion does not seem to be borne out
by the way the code acts.


On the contrary, it works for me.
If I resize my browser (IE6) to the middle of the screen, I can drag
something off to the left. While my cursor is outside of the browser window
completely, I can still move the image around (and my cursor stays as a
'move' graphic). When I let go, outside of the browser window, it stops
dragging. This was the behavior that the OP was asking for, I believe.

Mandy Memphis wrote: I just wish his code wasn't so cryptic!


Me too, he has some good functions in there. But trying to reuse or alter
any of them is more work than it's worth...

--
Matt Kruse
Javascript Toolbox: http://www.JavascriptToolbox.com/
Jul 23 '05 #5
On Mon, 5 Jul 2004 14:53:12 -0500, Matt Kruse wrote:
Andrew Thompson wrote:
Walter Zorn has managed it. See here:
http://www.walterzorn.com/dragdrop/dragdrop_e.htm

You assertion does not seem to be borne out
by the way the code acts.


On the contrary, it works for me.
If I resize my browser (IE6)


Oops, my bad.. forgot to mention I tested in
Moz 1.3.. (actually I did not even notice till
you mentioned the page, I had both browsers
open at the time..)

Probably some IE security hole.. ;-)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #6
Mandy Memphis wrote:
"Randy Webb" <hi************ @aol.com> wrote in message
news:8Y******** ************@co mcast.com...

<--snip-->
Hi Randy,

Walter Zorn has managed it. See here:
No, he has attempted to manage it. It fails, utterly, in Mozilla.
I drug the cat down, let go of the mouse outside the window, and even
while I am typing this, it is still attempting to scroll the cat down
even more.
http://www.walterzorn.com/dragdrop/dragdrop_e.htm

I just wish his code wasn't so cryptic!


When I see code like this:

href="javascrip t:void(0)"

I tend to stop reading anymore, as the author code such as that isn't
very aware of reality on the web.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 23 '05 #7
On Mon, 05 Jul 2004 19:27:08 -0400, Randy Webb wrote:
I drug the cat down, let go of the mouse outside the window,


Isn't is safe to let the mouse go inside the
window if the cat is drugged? Maybe not if
it's speed or coke though. ;-)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #8
"Randy Webb" <hi************ @aol.com> wrote in message
news:59******** ************@co mcast.com...
Mandy Memphis wrote:
"Randy Webb" <hi************ @aol.com> wrote in message
news:8Y******** ************@co mcast.com...


<--snip-->
Hi Randy,

Walter Zorn has managed it. See here:


No, he has attempted to manage it. It fails, utterly, in Mozilla.
I drug the cat down, let go of the mouse outside the window, and even
while I am typing this, it is still attempting to scroll the cat down
even more.
http://www.walterzorn.com/dragdrop/dragdrop_e.htm

I just wish his code wasn't so cryptic!


When I see code like this:

href="javascrip t:void(0)"

I tend to stop reading anymore, as the author code such as that isn't
very aware of reality on the web.


He was aware enough to get something to work that you said couldn't be done!
;-P
Jul 23 '05 #9
Randy Webb wrote:
When I see code like this:
href="javascrip t:void(0)"
I tend to stop reading anymore, as the author code such as that isn't
very aware of reality on the web.


I don't think that's a fair statement.
Obviously, Mr. Zorn is not a newbie script kiddie, and to be so judgemental
of his abilities based on a snippet of code is a bit unwarranted, IMO.

--
Matt Kruse
Javascript Toolbox: http://www.JavascriptToolbox.com/
Jul 23 '05 #10

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

Similar topics

10
4114
by: Frances Del Rio | last post by:
pls, why is this not working? <SCRIPT language=JavaScript type="text/javascript"> var br = '<SCRIPT language=Javascript' br += 'src="js_pop.js" type="text/javascript">' br += '</SCRIPT>' var op = '<SCRIPT language=Javascript' op += 'src="js_pop-op.js" type="text/javascript">' op += '</SCRIPT>' if (navigator.userAgent.indexOf('Opera') != -1 ) {
2
5780
by: David Wake | last post by:
I am a complete Javscript newbie trying to produce a user interface similar to Google Maps -- the user should be able to click anywhere on the map and drag it in any direction. The Javascript works OK when the map is only dragged a few pixels. If the map is dragged any significant distance, however, the cursor changes to a document-like icon (in Firefox 1.5) or a circle with a line through it (in IE 5) and no onMouseUp event is fired on...
79
3763
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the relevant name owner? If I make a whisky and call it "Jack Daniels", I most probably will have some serious legal problems. "Mozilla" partially appeared because NCSA stopped them from using "Mosaic" in the UA string. Is it some different...
5
13656
by: Dag Sunde | last post by:
Is it possible to detect if the user minimizes the browser-window? I do some polling, and want to stop it while the window in minimized, but not when it only is blurred... TIA... -- Dag.
3
1545
by: mk | last post by:
Hi I'v got the following javascript (part of it) that works with the event onmouseup: // Attach event handlers to all images within container LICollection=document.getElementById("MDME").getElementsByTagName("LI"); if (LICollection!=null) { for (l=0; l<LICollection.length; l++) {LICollection.item(l).onmouseup=onMouseUpHandler;}
1
3056
by: Jason | last post by:
I am creating a Comet/Ajax chatroom system. When people go to the page, it will add them to the list of people in the room via window.onload. When they leave, disconnect, go to another page, or close browser, I need to remove them from the room. I use window.onbeforeunload, but it seems it doesn't always fire. IE & firefox will only unload sometimes - sometimes I think maybe its caching the page, and not calling onbeforeunload (my...
9
7596
by: jon | last post by:
Hello, I'm trying to experiment with some javascript to do some custom dragdrop handling. I wish to use the onMouseDown event to trigger the start of my drag, and onMouseup for a potentential drop. I hope to turn on the onmouseup only in onmousedown. And eventually go one step further and incorporate onmousemove for a true drag workflow. I'm running into a problem however, where after mousedown, mouseup will not fire when I release...
1
2312
by: Mango | last post by:
I'm trying to print some text in a very specific position on a page, so that it will show through the window of an envelope when folded. This is easy to do, as long as the browser's print margins are set to 0, or I subtract the width of the margins from the position of the text. My question is: is there a technique for detecting browser print margins? It'd be nice not to have to warn users to set them to something specific.
11
3458
by: yawnmoth | last post by:
http://www.frostjedi.com/terra/scripts/demo/onmouseup.html In Firefox, if I click in the black box and then release, I get a popup. If I click, drag the cursor, and then release, I don't. Similarly, if I click and then release outside of the black box, I don't get a popup, and I don't understand why. If I comment out "document.getElemenById("demo").onmousedown = mousedown;", it works. Why would that make a difference?
0
8964
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8806
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8808
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6460
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5820
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4324
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2975
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1960
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.