1、我们在桌面新建一个文本文档,并且打开。
2、
在文档里添加以下HTML代码。
特效演示_JS测试显示器分辨率document.write('您的显示器分辨率为:\n' + screen.width + '*' + screen.height + ' pixels
');
var ww = document.getElementById("hutia").offsetWidth, w = screen.width/ww, h = screen.height/ww, r = Math.round(Math.sqrt(w*w + h*h) / 2.54, y = Math.round(Math.sqrt(w*w + h*h) *0.3));
document.write('您的显示器尺寸为:\n' + (screen.width/ww).toFixed(1) + '*' + (screen.height/ww).toFixed(1) + ' cm, '+ r +'英寸, '+ y + '寸
');
3、选择文件,另存为,保存类型选择所有文件,保存的文件名更改为检测屏幕.html,然后保存。
4、使用浏览器打开检测屏幕.html,即可显示检测结果。