<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>demo</title>
<script>
function openWin(){
var screenX = window.screenX || window.screenLeft;
var screenY = window.screenY || window.screenTop;
document.getElementsByTagName('p')[0].innerHTML =
"window.screenX:"+window.screenX+"</br>"+"window.screenY:"+window.screenY+"</br>"+"window.screenLeft:"+window.screenLeft+"</br>"+"window.screenTop:"+window.screenTop+"</br>"+screenX+"</br>"+screenY;
}
</script>
</head>
<body>
<button οnclick="openWin()">click me</button> </br>
<p></p>
</body>
</html>
window.screenX,window.screenLeft
最新推荐文章于 2023-08-15 19:21:02 发布