HTML5
发布时间:2022-04-25 发布网站:大佬教程 code.js-code.com
大佬教程收集整理的这篇文章主要介绍了HTML5鼠标悬停在矩形上可以看到坐标,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<!DOCTYPE HTML> <html> <head> <style type="text/css"> body
{ font-size:70%; font-family:verdana,
Helvetica,arial,sans-serif; } </style> <script type="text/javascript"> function cnvs_getCoordinates(
E) { x=e.clientX; y=e.clientY; document.getElementById("xycoordinates").innerHTML="Coordinates: (" + x + "," + y + ")"; } function cnvs_clearCoordinates()
{ document.getElementById("xycoordinates").innerHTML=""; } </script> </head> <body style="margin:0px;"> <p>把鼠标悬停在下面的矩形上可以看到坐标:</p> <div id="coordiv" style="float:left;width
:199px;height:99px;border
:1px solid #c3c3c3" onmousemove="cnvs_getCoordinates(event)" onmou
SEOut="cnvs_clearCoordinates()"></div> <br /> <br /> <br /> <div id="xycoordinates"></div> </body> </html>
大佬总结
以上是大佬教程为你收集整理的HTML5鼠标悬停在矩形上可以看到坐标全部内容,希望文章能够帮你解决HTML5鼠标悬停在矩形上可以看到坐标所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。