欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JS網(wǎng)頁(yè)在線獲取鼠標(biāo)坐標(biāo)值的方法

 更新時(shí)間:2015年02月28日 10:27:28   投稿:shichen2014  
這篇文章主要介紹了JS網(wǎng)頁(yè)在線獲取鼠標(biāo)坐標(biāo)值的方法,涉及javascript操作頁(yè)面窗口位置元素的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了JS網(wǎng)頁(yè)在線獲取鼠標(biāo)坐標(biāo)值的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

復(fù)制代碼 代碼如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>顯示鼠標(biāo)坐標(biāo)</title>
</head>
<body onMousemove="micro$oftMouseMove()">
<SCRIPT LANGUAGE="JavaScript">
if (navigator.appName == 'Netscape')
{
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = netscapeMouseMove;
}
function netscapeMouseMove(e) {
if (e.screenX != document.test.x.value && e.screenY != document.test.y.value);
{
document.test.x.value = e.screenX;
document.test.y.value = e.screenY;
}
}
function micro$oftMouseMove() {
if (window.event.x != document.test.x.value && window.event.y != document.test.y.value);
{
document.test.x.value = window.event.x;
document.test.y.value = window.event.y;
}
}
</SCRIPT>
<FORM NAME="test">
X: <INPUT TYPE="TEXT" NAME="x" SIZE="4">
Y: <INPUT TYPUE="TEXT" NAME="y" SIZE="4">
</FORM>
</body>
</html>

希望本文所述對(duì)大家的javascript程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論