获取设备的物理像素

获取设备的物理像素

<script>
   // 以像素计,屏幕的大小
    var screenWidth = window.screen.width;
    var screenHeight = window.screen.height;

    console.log('屏幕的宽度为' + screenWidth);
    console.log('屏幕的高度为' + screenHeight);
</script> 

猜你喜欢

转载自blog.csdn.net/qq_35457469/article/details/88598968