JS获取鼠标坐标代码
来源:互联网 发布:天刀五毒女捏脸数据 编辑:程序博客网 时间:2024/05/29 07:48
- JS获取鼠标坐标,获取鼠标像素点的典型实例,运行本页面后,随意移动鼠标的位置,可适时显现鼠标的坐标点,不占用系统资源 。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>JavaScript获取鼠标坐标</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style type="text/css">.tip {width:200px;border:2px solid #ddd;padding:8px;background:#f1f1f1;color:#666;}</style><script type="text/javascript"> function mousePos(e){var x,y;var e = e||window.event;return {x:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,y:e.clientY+document.body.scrollTop+document.documentElement.scrollTop};};function test(e){document.getElementById("mjs").innerHTML = mousePos(e).x+','+mousePos(e).y; };</script></head><body><div id="mjs" class="tip">源码爱好者</div><div id="test" style="width:1000px;height:1000px;background:#ccc;" onmousemove="test(event)"></div></body></html>
0 0
- JS获取鼠标坐标代码
- js获取鼠标坐标
- js获取鼠标坐标
- JS获取鼠标坐标
- js获取鼠标坐标
- js获取鼠标坐标
- js 获取鼠标点击坐标
- js获取鼠标坐标位置
- JS获取鼠标的坐标
- JS获取鼠标的坐标
- js获取鼠标点击坐标
- 随鼠标获取鼠标的坐标代码
- js 火狐 iE 通用获取鼠标坐标,获取元素坐标
- js event对象获取鼠标坐标
- 获取当前鼠标的坐标 js
- js获取鼠标点击时坐标
- HTML--js获取鼠标点击坐标
- js获取鼠标移动时的坐标
- 使用ffmpeg步骤
- 如何给MFC对话框添加背景图片
- 浅谈软件测试流程
- oracle 字符集查看与修改
- hibernate集合映射inverse和cascade详解
- JS获取鼠标坐标代码
- java中文打印显示乱码
- 一个简单的五子棋判胜算法
- 21 Android 屏幕的宽高
- apktool打包出错
- ExtAspNet配置问题
- hibernate 常用方法
- 交互设计[3]--点石成金
- Python的基础知识