⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 20.6 检测屏幕分辨率.htm

📁 这是一些常用的JavaScript的特效的源码和教程
💻 HTM
字号:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>标题页</title>
     <script language="JavaScript">
     function getScreen() 
     {
	if ((screen.width == 640) && (screen.height == 480)) 
	    size = "640 x 480";
	else if ((screen.width == 800) && (screen.height == 600))
	    size = "800 x 600";
	else if ((screen.width == 1024) && (screen.height == 768))
	    size = "1024 x 768";
	else if ((screen.width == 1280) && (screen.height == 1024))
	    size = "1280x1024";
	else 
            size = "默认值为640 x 480";
	alert("屏幕分辨率为 " + size );
    }
    </script>
</head>
<body>
<input id="Button1" type="button" value="获取屏幕分辨率" onclick="getScreen()" />
</body>
</html>

⌨️ 快捷键说明

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