js获取screen屏幕的一些尺寸

284 阅读1分钟

1、屏幕的宽高

console.log(screen.width + "*" + screen.height)
// 1920*1080

2、获取屏幕的可用宽高

console.log(screen.availWidth + "*" + screen.availHeight)
// 1920*1040

3、屏幕的尺寸

console.log(screen.pixelDepth)
// 24