在浏览器窗口外检测onmouseup? [英] Detecting onmouseup outside browser window?

查看:73
本文介绍了在浏览器窗口外检测onmouseup?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在文档中执行mousedown,将鼠标移到

浏览器窗口之外,然后释放鼠标按钮,document.onmouseup

事件不会火。有没有办法检测

文件之外的鼠标事件?


另外,如何获得光标的相对坐标? />
浏览器外?


谢谢。

If I perform a mousedown within a document, move the mouse outside the
browser window, and then release the mouse button, the document.onmouseup
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.

推荐答案

Mandy Memphis写道:
Mandy Memphis wrote:
如果我在文档中执行mousedown,将鼠标移到
浏览器窗口之外,然后释放鼠标按钮,document.onmouseup
事件不会触发。有没有办法检测
文档之外的mouseup事件?


No.

另外,如何在浏览器外面获取光标的相对坐标?
If I perform a mousedown within a document, move the mouse outside the
browser window, and then release the mouse button, the document.onmouseup
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?




你不能。


-

兰迪

Chance Favors准备好的心灵

comp.lang.javascript常见问题 - http:// jibbering .com / faq /


" Randy Webb" <喜************ @ aol.com>在消息中写道

新闻:8Y ******************** @ comcast.com ...
"Randy Webb" <hi************@aol.com> wrote in message
news:8Y********************@comcast.com...
Mandy孟菲斯写道:
Mandy Memphis wrote:
如果我在文档中执行mousedown,将鼠标移到
浏览器窗口外,然后释放鼠标按钮,
document.onmouseup事件不会火。有没有办法检测文件外
以外的鼠标事件?
If I perform a mousedown within a document, move the mouse outside the
browser window, and then release the mouse button, the document.onmouseup 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管理过它。请参阅:

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


我只是希望他的代码不是那么神秘!



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!


2004年7月5日星期一13:15:03 -0400,Mandy Memphis写道:
On Mon, 5 Jul 2004 13:15:03 -0400, Mandy Memphis wrote:
" Randy Webb" <喜************ @ aol.com>在消息中写道
"Randy Webb" <hi************@aol.com> wrote in message
Mandy Memphis写道:
Mandy Memphis wrote:
如果我在文档中执行mousedown,将鼠标移到
浏览器窗口之外,然后释放鼠标按钮,document.onmouseup事件不会触发。有没有办法检测文档外的mouseup事件?
If I perform a mousedown within a document, move the mouse outside the
browser window, and then release the mouse button, the document.onmouseup 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管理它。请参阅:

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




您的断言似乎没有被证实

的代码方式行动。


EG如果你把你的浏览器窗口设置为小并且

将它放在屏幕中间,你可以将鼠标拖出窗口右边的
,图像

将继续滚动(太右)。当图像

继续滚动(在网页内),你可以移动

鼠标指针在窗口外面,

时你在左边输入它,脚本似乎

识别*那个*和仍在滚动的图像

现在跳到屏幕的左边。 />

这种行为支持Randy所说的,

脚本不知道

鼠标的合作超出窗口。


这是一个安全的东西AFAIU,你不需要一些来自网页的

脚本能够监控你的内容>
超出浏览器,可以允许各种各样的讨价还价的窥探。


-

安德鲁汤普森
http://www.PhySci.org/ 开源软件套件
http://www.PhySci.org/codes/ 网络和放大器; IT帮助
http://www.1point1C.org/ Science&技术



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


这篇关于在浏览器窗口外检测onmouseup?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆