中文(简体)
<!-- 将以下代码放到<head>区域中--> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var x, y, xold, yold, xdiff, ydiff; var dir = 数组(); dir[0] = "n-调整大小"; dir[1]="ne-调整大小"; dir[2]="e-调整大小"; dir[3]="se-调整大小"; dir[4] = "s-调整大小"; dir[5]="sw-调整大小"; dir[6]="w-调整大小"; dir[7]="nw-调整大小"; document.onmousemove = FindXY;函数显示(方向){ document.body.style.cursor = dir[方向]; } 函数 FindXY(loc) { x = (document.layers) ? loc.pageX : 事件.clientX; y = (文档.层) ? loc.pageY : 事件.clientY; xdiff = x - xold; ydiff = y - yold if ((xdiff < 2) && (ydiff < -2)) 显示(0); if ((xdiff < 2) && (ydiff > 2)) 显示(4); if ((xdiff > 2) && (ydiff < 2)) 显示(2); if ((xdiff < -2) && (ydiff < 2)) 显示(6); if ((xdiff > 2) && (ydiff > 2)) 显示(3); if ((xdiff > 2) && (ydiff < -2)) 显示(1); if ((xdiff < -2) && (ydiff > 2)) 显示(5); if ((xdiff < -2) && (ydiff < -2)) 显示(7); xold=x; yold = y; } // 结束 --> </script>