2010-06-19 54 views

回答

0

我发现这一点:http://www.codelifter.com/main/javascript/capturemouseposition1.html,在IFRAME鼠标位置是相对于iframe的位置:

<html> 
<body> 

<iframe src ="http://www.codelifter.com/main/javascript/capturemouseposition1.html" style="position:relative;left:25%;width:75%;height:500px"> 
</iframe> 

</body> 
</html> 

的鼠标位置的检测,你可以在我已经写了页面找到。

编辑: 我找到这篇文章:http://parentnode.org/javascript/working-with-the-cursor-position/。并阅读评论,因为修复了一些错误。也许它会帮助你:)

+0

Miro,我需要知道光标的位置而不是鼠标。鼠标位置由鼠标事件提供。 – Rajiv 2010-08-10 05:11:36

+1

光标和鼠标有什么区别?你的意思是光标在监视器上的绝对位置? – kravemir 2010-08-11 14:23:56

+0

他可能是指插入位置。它那个闪烁的小棒或盒子,随着你的输入而进步。 – 2010-08-19 18:48:28

相关问题