clientX/clientY at KEY EVENTS

[2011-12-27 18:12:15 --@Javascript]

键盘事件的 鼠标坐标值 是用不上的. 但却在某些浏览器下可以取到:

document.onkeydown=function(){
console.log(window.event.clientY);
}


position relative to the client area of the window, excluding window decorations and scroll bars.

这个值可以是负值:在鼠标在缩小的窗口之外时。

本文禁止复制/转载!

新增评论

分类导航