【问题标题】:Can a webpage detect if an external display is connected?网页能否检测到是否连接了外接显示器?
【发布时间】:2014-08-20 05:24:29
【问题描述】:

我知道我可以使用window.screen.width.height 获得屏幕的尺寸,但这只会给我浏览器当前所在的显示/屏幕。有没有办法找到是否连接了另一台显示器?

【问题讨论】:

    标签: javascript screen-size multiple-monitors


    【解决方案1】:

    试试window.screen[2].widthwindow.screen[2].height

    【讨论】:

    • 只有当窗口横跨两个屏幕时才有效,不是吗?
    • 当我尝试索引 window.screen 时,我得到了未定义 - 无论窗口在哪个屏幕上(或者如果它跨越两个屏幕)
    猜你喜欢
    • 2015-10-19
    • 2018-12-27
    • 2022-01-14
    • 2010-09-20
    • 2023-03-30
    • 2011-09-30
    • 1970-01-01
    相关资源
    最近更新 更多