企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` <div id="areaXY" style="width: 300px;height:200px;background-color: aquamarine;border:5px solid darkred; margin: 25px;"> 300*200 </div> <div id="info" style="width: 300px;height:40px;background-color: aquamarine;border:5px solid darkred; margin: 25px;"> </div> <script type="text/javascript"> window.onload=function(){ var info=document.getElementById("info"); var areaXY=document.getElementById("areaXY"); areaXY.onmousemove=function(event){ //IE8及以下事件响应函数被触发时不会传递event对象,而是作为window的属性保存 if(!event){ event=window.event; } var X=event.clientX; var Y=event.clientY; var sX=event.screenX; var sY=event.screenY; info.innerHTML="x:"+X+"&nbsp;&nbsp;&nbsp;&nbsp;y:"+Y; info.innerHTML+="screenX:"+sX+"&nbsp;&nbsp;&nbsp;&nbsp;screenX:"+sY; } } </script> ```