【问题标题】:Javascript: Count number of screenJavascript:计算屏幕数量
【发布时间】:2014-04-22 06:06:44
【问题描述】:

我们正在开发一个使用 4 个屏幕的 Web 应用程序。有没有办法统计屏幕数量?

【问题讨论】:

标签: javascript html web-applications


【解决方案1】:

这可能会有所帮助

假设屏幕为矩形排列,所有屏幕的高度和宽度相同。

 /// total window width divided by single screen width

var h_screens = Math.round(window.outerWidth / window.screen.availWidth);

 /// total window height divided by single screen height
var v_creens = Math.round(window.outerHeight / window.screen.availHeight);
var total_screens = h_screens * v_creens;
  • ▆ ▆
    ▆ ▆

    4 = 2* 2;

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2013-01-12
  • 2017-02-06
  • 2022-01-03
  • 2020-02-12
  • 2019-11-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多