examplewindowproperties.html

来自「javascript tutorial」· HTML 代码 · 共 28 行

HTML
28
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="ltr" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
	<title>Example: Window properties</title>
	<style type="text/css">
	</style>
	<script type="text/javascript">
	function winProps(){
		var winWidth=window.outerWidth;
		var winHeight=window.outerHeight;
		var docWidth=window.innerWidth;
		var docHeight=window.innerHeight;
		var message='This window is ';
		message+=winWidth+' pixels wide and ';
		message+=winHeight+' pixels high.\n';
		message+='The inner dimensions are:';
		message+=docWidth+' * '+docHeight+' pixels';
		alert(message);
	}
	window.onload=winProps;
	</script>
</head>
<body>

</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?