【发布时间】:2014-04-22 06:06:44
【问题描述】:
我们正在开发一个使用 4 个屏幕的 Web 应用程序。有没有办法统计屏幕数量?
【问题讨论】:
标签: javascript html web-applications
我们正在开发一个使用 4 个屏幕的 Web 应用程序。有没有办法统计屏幕数量?
【问题讨论】:
标签: javascript html web-applications
这可能会有所帮助
假设屏幕为矩形排列,所有屏幕的高度和宽度相同。
/// 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;
【讨论】: