您现在的位置是:首页 > 学无止境
Javascript鼠标坐标
script type="text/javascript">function mousePosition(ev){ if(ev.pageX || ev.pageY){ return {x:ev.pageX, y:ev.pa...
<
script
type
=
"text/javascript"
>
function mousePosition(
ev)
{
if(
ev.
pageX |
|
ev.
pageY)
{
return {
x:
ev.
pageX,
y:
ev.
pageY}
;
}
return {
x:
ev.
clientX +
document.
body
.
scrollLeft -
document.
body
.
clientLeft,
y:
ev.
clientY +
document.
body
.
scrollTop -
document.
body
.
clientTop
}
;
}
document.
onmousemove
=
mouseMove;
function mouseMove(
ev)
{
ev =
ev |
|
window.
event;
var
mousePos =
mousePosition(
ev)
;
document.
getElementById(
'mouseXPosition'
)
.
value
=
mousePos.
x;
document.
getElementById(
'mouseYPosition'
)
.
value
=
mousePos.
y;
}
<
/
script
>
<
fieldset
>
<
input
id
=
mouseXPosition>
<
input
id
=
mouseYPosition>
<
/
fieldset
>
文章评论
- 登录后评论
点击排行
-
php-fpm安装、配置与优化
转载自:https://www.zybuluo.com/phper/note/89081 1、php中...
-
centos下postgresql的安装与配置
一、安装(以root身份进行)1、检出最新的postgresql的yum配置从ht...
-
Mysql的大小写敏感性
MYSQL在默认的情况下查询是不区分大小写的,例如:CREATE TABLE...
-
关于URL编码
转载自:http://www.ruanyifeng.com/blog/2010/02/url_encoding....
-
header中的Cache-control
网页的缓存是由HTTP消息头中的“Cache-control”来控制的,常见的...