如何用javascript获得当前鼠标所在的位置??? window.event.clientXwindow.event.clientY 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <input type=button onclick="alert(window.event.clientX+':'+window.event.clientY);"> var isIE = document.all?true:false;if (!isIE) document.captureEvents(Event.MOUSEMOVE);document.onmousemove = getMousePosition;function getMousePosition(e) { if (!isIE) { _x = e.pageX; _y = e.pageY; } if (isIE) { _x = event.clientX ; _y = event.clientY ; } return true;}我想这个对你一定有用,我现在就用这个了 关于闭包面试题求解答 javascript自定义类的方法问题 无刷新 无限加载..infinite-scroll.. 高分请教一个正则 被遗忘的onload事件 关于层的显示和隐藏,不会做啊 如何控制文件浏览控件<INPUT type="file">的Filter属性? 有关复选框的问题请教? WSC居然不支持中文!!!有解决办法吗? 为什么在js中220.16+126计算的结果是346.15999999999997 简单iframe的问题 在popup里iframe不显示怎么办呀
if (!isIE) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMousePosition;
function getMousePosition(e) {
if (!isIE) {
_x = e.pageX;
_y = e.pageY;
}
if (isIE) {
_x = event.clientX ;
_y = event.clientY ;
}
return true;
}我想这个对你一定有用,我现在就用这个了